xref: /dflybsd-src/contrib/lvm2/dist/scripts/lvm2create_initrd/README (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marinohttp://poochiereds.net/svn/lvm2/
286d7f5d3SJohn Marino
386d7f5d3SJohn MarinoThis is the lvm2create_initrd script written by Miguel Cabeca, with some small
486d7f5d3SJohn Marinomodifications by myself.
586d7f5d3SJohn Marino
686d7f5d3SJohn MarinoHere are some other requirements and tips for using it:
786d7f5d3SJohn Marino
886d7f5d3SJohn Marino1) this script uses busybox on the initrd image, hence busybox needs to be
986d7f5d3SJohn Marinoinstalled when you create your initrd.
1086d7f5d3SJohn Marino
1186d7f5d3SJohn Marino2) Make sure /etc/lvm/lvm.conf is set up correctly before running this. In
1286d7f5d3SJohn Marinoparticular, if you're using LVM on RAID, make sure that you have a filter that
1386d7f5d3SJohn Marinoexcludes the RAID component devices (this may not be necessary with the latest
1486d7f5d3SJohn Marinopatch by Luca Berra, but it doesn't hurt).
1586d7f5d3SJohn Marino
1686d7f5d3SJohn Marino3) This initrd image does not support modules. If you need to plug in any
1786d7f5d3SJohn Marinokernel modules during the initrd phase, then you'll need to hand-modify the
1886d7f5d3SJohn Marinoimage.
1986d7f5d3SJohn Marino
2086d7f5d3SJohn Marino4) The generated initrd image supports an 'lvm2rescue' mode as well. If you add
2186d7f5d3SJohn Marinothe parameter 'lvmrescue' on the kernel command line, it will run a shell at
2286d7f5d3SJohn Marinothe end of the initrd 'init' script. This can be helpful when trying to fix a
2386d7f5d3SJohn Marinocorrupt root volume or root LVM2 volume group.
2486d7f5d3SJohn Marino
2586d7f5d3SJohn Marino5) No userspace md tools are installed, so if you're using LVM on RAID, then
2686d7f5d3SJohn Marinoyou'll probably want to mark your RAID partitions as type 'fd' so that the
2786d7f5d3SJohn Marinokernel will start them automagically (or hand-modify the image).
2886d7f5d3SJohn Marino
2986d7f5d3SJohn Marino6) I'm not sure if devfs will work with this or not. udev, however does work,
3086d7f5d3SJohn Marinoand is recommended. Because the dm-* devices use dynamically allocated major
3186d7f5d3SJohn Marinoand minor numbers, kernel upgrades and the like can renumber your devices. To
3286d7f5d3SJohn Marinofix this, you need to run a 'vgscan --mknodes' prior to fscking and mounting
3386d7f5d3SJohn Marinoyour rootfs. Doing this with a static /dev creates a problem though -- you
3486d7f5d3SJohn Marinowill be modifying the root filesystem before it has been fsck'ed. udev gets
3586d7f5d3SJohn Marinoaround this by mounting a ramdisk over /dev, but you'll probably need to add
3686d7f5d3SJohn Marinoa startup script that creates devices in /dev. The lvm2udev script in this
3786d7f5d3SJohn Marinodirectory is an example of such a beast.
3886d7f5d3SJohn Marino
3986d7f5d3SJohn Marino--
4086d7f5d3SJohn MarinoJeffrey Layton <jtlayton@poochiereds.net>
41