Gentoo Archives: gentoo-server

From: aechols@××××××××××××.edu
To: gentoo-server@g.o
Subject: Re: [gentoo-server] LVM not working after reboot
Date: Sat, 13 Dec 2003 20:52:05
Message-Id: 1071370324.3fdbd0541f881@webmail.physics.tamu.edu
In Reply to: Re: [gentoo-server] LVM not working after reboot by Thomas Smith
1 Quoting Thomas Smith <tom@××××××××××××××.org>:
2 > I've begun looking into how to create an initrd image so I can modify
3 > the stock Gentoo one to include the RAID and LVM drivers--any pointers
4 > to docs that will help me along this path are appreciated.
5
6 Altering the initrd LVM creates would probably work. After you un-gzip the
7 initrd, you have a ordinary file containing an ext2 filesystem. You can mount
8 it with -o loop and copy in additional files like raidstart and whatever it
9 depends on. You can use ldd to figure out if there are libraries that need to
10 be copied in as well. Finally, the linuxrc file in the root of the initrd is
11 just a small script that runs before the kernel tries mounting the real root.
12 The linuxrc that comes with an LVM initrd looks like this:
13
14 #!/bin/sh
15 /bin/mount /proc
16 /sbin/vgscan
17 /sbin/vgchange -a y
18 /bin/umount /proc
19
20 All this does is get LVM running to the point where the lvm devices exist and
21 work. vgscan finds all the attached volume groups, then vgchange activates them
22 for use by the kernel when it mounts root. Likewise, if you need to start raid
23 before the kernel starts mounting, you could just add raidstart to that script
24 and copy in the binary so that it starts before the kernel tries to mount. Once
25 your initrd is set up like you want it, just unmount it and re-gzip it. If you
26 need more room to copy stuff in, resize2fs should be able to make the image
27 larger while it's unmounted.
28
29 -Andy
30
31 -------------------------------------------------
32 This mail sent through IMP: http://horde.org/imp/