linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andre Noll <maan@systemlinux.org>
To: Nix <nix@esperi.org.uk>
Cc: linux-raid@vger.kernel.org
Subject: Re: A random initramfs script
Date: Wed, 15 Mar 2006 01:25:27 +0100	[thread overview]
Message-ID: <20060315002527.GO27173@skl-net.de> (raw)
In-Reply-To: <87u0a0so6w.fsf@hades.wkstn.nix>

[-- Attachment #1: Type: text/plain, Size: 3199 bytes --]

On 21:37, Nix wrote:

> In the interests of pushing people away from in-kernel autodetection,
> I thought I'd provide the initramfs script I just knocked up to boot
> my RAID+LVM system.  It's had a whole four days of testing so it must
> work. :)

I'm using a similar setup since December or so with no problems so
far. However, all my systems have initramfs as their rootfs.

>  - it doesn't waste memory. initramfs isn't like initrd:
>    if you just chroot into the new root filesystem, the
>    data in the initramfs *stays around*, in *nonswappable*
>    kernel memory. And it's not gzipped by that point, either!

If you really care, you can remove almost everything from the initramfs
just before mounting root. But that's not really necessary unless you
are very short on memory. BTW: I'm also using a complete rescue system
(45 MB unpacked) which has everything on initramfs. lilo boots this
25 MB kernel just fine, and so does etherboot.

> The downsides:
> 
>  - if you link against uClibc (recommended), you need a CVS
>    uClibc too (i.e., one newer than 0.9.27).

glibc works also fine. For the records: You'll need these:

/lib/ld-linux.so.2
/lib/libc.so.6
/lib/libwrap.so.2
/lib/libnsl.so.1
/lib/libnss_nis.so.2
/lib/libnss_files.so.2
/lib/libnss_compat.so.2

>  - it doesn't try to e.g. set up the network, so it can't do really
>    whizzy things like mount a root filesystem situated on a network
>    block device on some other host: if you want to do something like
>    that you've probably already written a script to do it long ago

Yep. Here's what I do for my discless clients (no more nfsroot needed):

ifconfig eth0
route del default
route add default gw $NET.$gw_ip eth0
portmap
ifconfig lo 127.0.0.1
route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
# mount nfs filesystems

>  - you need an /etc/mdadm.conf and an /etc/lvm/lvm.conf, both taken
>    by default from the system you built the kernel on: personally
>    I'd recommend a really simple one with no device= lines, like
> 
> DEVICE partitions
> ARRAY /dev/md0 UUID=some:long:uuid:here
> ARRAY /dev/md1 UUID=another:long:uuid:here
> ARRAY /dev/md2 UUID=yetanother:long:uuid:here

The following works pretty well for me:

	echo "DEVICE /dev/hd*[0-9] /dev/sd*[0-9] /dev/md[0-9]" > /etc/mdadm.conf
	mdadm --examine --scan --config=/etc/mdadm.conf  >> /etc/mdadm.conf
	mdadm --assemble --scan

> Anyway, without further ado, here's usr/init:
> 

> /sbin/mdev -s

What's mdev? udevstart works too, but it seems to be depreciated now.

> # Assemble the RAID arrays.
> /sbin/mdadm --assemble --scan --auto=md --run

Minor suggestion:

	if test -e /proc/mdstat; then /sbin/mdadm ...

> # Scan for volume groups.
> /sbin/lvm vgscan --ignorelockingfailure --mknodes && /sbin/lvm vgchange -ay --ignorelockingfailure

Similarly,

	if test -c /dev/mapper/control; then ...

> And usr/initramfs (will need adjustment for your system):

> file /sbin/lvm /usr/i686-pc-linux-uclibc/sbin/lvm 0755 0 0

Isn't libdevmapper also needed?

Regards,
Andre
-- 
The only person who always got his work done by Friday was Robinson Crusoe

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-03-15  0:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 21:37 A random initramfs script Nix
2006-03-15  0:25 ` Andre Noll [this message]
2006-03-15  8:29   ` Nix
2006-03-15 18:57     ` Andre Noll
     [not found]       ` <87hd5zs9zm.fsf@hades.wkstn.nix>
2006-03-16  0:23         ` Andre Noll
     [not found]           ` <87zmjqq14r.fsf@hades.wkstn.nix>
2006-03-16 23:46             ` Andre Noll
2006-03-17  0:41               ` Nix
2006-03-17  3:35                 ` Andre Noll
2006-03-17 14:58                   ` Nix
2006-03-16  4:23       ` Neil Brown
2006-03-16  7:39         ` Nix
2006-03-17  1:22         ` Andre Noll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060315002527.GO27173@skl-net.de \
    --to=maan@systemlinux.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=nix@esperi.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).