lvmcreate_initrd - create an initial ramdisk to boot with root on a logical volume
lvcmreate_initrd [-i|--iop IOP] [-D|--devfs] [-v|--verbose] [-V|--version] [KernelVersion]
lvmcreate_initrd creates a new compressed initial ramdisk /boot/initrd-lvm-KernelVer-
sion.gz. The initial ramdisk contains all necessary binaries, shared libraries and a lin-
uxrc file to switch to a logical volume based root filesystem. To build an initial
ramdisk for a kernel other than the one currently running add the KernelVersion parameter
(e.g. lvmcreate_initrd 2.3.25) on the command line.
Print a usage message on standard output and exit.
-i, --iop IOP
Specify the LVM kernel IOP version if you are using wrapper scripts in /sbin. This
is only necessary if you are building an initrd for a kernel other than the current
one, and you have tools for multiple IOP versions installed.
Force the use of devfs when building the initrd. lvmcreate_initrd by default
probes for devfs by checking for /dev/.devfsd, which is created by devfsd when it
is running. This option will force lvmcreate_initrd to do this, when devfsd is not
Gives verbose runtime information about the creation of the ram disk image.
Print version number and exit successfully.
The necessary actions to change your system into a "root on logical volume" one are:
Create a small (~20MB) partition which is BIOS reachable to hold the /boot filesystem (if
you already have a small partition based root filesystem this can be used instead). If you
want to boot standalone from this partition in an emergency, copy all the necessary bina-
ries and libraries to that filesystem as well and create a corresponding /etc/lilo.conf
entry. In order to be able to edit lilo.conf when booted standalone, you should move
/etc/lilo.conf to /boot/lilo.conf and create a symbolic link to it in /etc. This is not
needed if you have a boot/root floppy which contains the LVM binaries and the library.
Create all logical volumes you need (for root, usr, opt etc.), create filesystems in them,
mount them and transfer all files from the partition based filesystems into the logical
volume based ones.
Set up your /etc/lilo.conf with a boot configuration like:
image = /boot/vmlinuz
initrd = /boot/initrd-lvm-KernelVersion.gz
root = /dev/YourVG/YourRootLV
label = rootonlv
append = 'ramdisk_size=8192'
Replace YourVG and YourRootLV by your actual volume group and root logical volume names.
You also need to change the ramdisk size to be at least as large as that reported while
lvmcreate_initrd is run. If you have enough memory, it is OK if the ramdisk size in
/etc/lilo.conf is larger than what lvmcreate_initrd reports (the memory is freed after
booting). Also, your /etc/fstab in the root logical volume should contain entries for the
root LV, and the boot partition, along with any other LVs you have configured:
/dev/YourVG/YourRootLV / ext2 defaults 0 1
/dev/YourBootPartition /boot ext2 defaults 0 2
/dev/YourVG/YourUsrLV /usr ext2 defaults 0 3
/dev/YourVG/YourOptLV /opt ext2 defaults 0 4
You can use other supported filesystem types as well (e.g. reiserfs) if you have support
for those in your kernel. Run lilo, reboot and try...
The partitions containing the former /usr, /opt etc. filesystems can now be used as physi-
cal volumes. Use pvcreate(8) to turn them into PVs and then use vgextend(8) to add them
to e.g. YourVG.
lvcmcreate_initrd returns 0 for success. 1 is returned in all other cases.
lilo(8), lilo.conf(5), fstab(5), lvm(8), pvcreate(8), vgextend(8), lvcreate(8), vgcre-
Heinz Mauelshagen <Linux-LVM@Sistina.com>
Heinz Mauelshagen LVM TOOLS LVMCREATE_INITRD(8)