LVMCREATE_INITRD(8)

NAME
lvmcreate_initrd - create an initial ramdisk to boot with root on a logical volume

SYNOPSIS
lvcmreate_initrd [KernelVersion]

DESCRIPTION
lvmcreate_initrd creates a new compressed initial ramdisk in /boot/initrd.gz. The initial ramdisk contains all necessary binaries, shared libraries and a linuxrc 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 (eg. 2.3.25) on the command line.
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 binaries 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.
You have to setup your /etc/lilo.conf with a boot configuration like:
image = /boot/vmlinuz
initrd = /boot/initrd.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. In addition to that your /etc/fstab in your root logical volume should contain:
/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
etc.
You can use other supported filesystem types as well (eg. 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 physical volumes. pvcreate(8) them and add them eg. to YourVG.

DIAGNOSTICS
lvcmcreate_initrd returns 0 for success. 1 is returned in all other cases.

See also
lvm(8), pvcreate(8), vgcreate(8), lvcreate(8)

AUTHOR
Heinz Mauelshagen <Linux-LVM@Sistina.com>