Fixing unbootable installation on LVM root from Desktop LiveCD

Posted by intuited on Ask Ubuntu See other posts from Ask Ubuntu or by intuited
Published on 2011-02-17T20:33:33Z Indexed on 2011/02/17 23:33 UTC
Read the original article Hit count: 580

Filed under:
|
|
|

I just did an installation from the 10.10 Desktop LiveCD, making the root volume an LVM LV.

Apparently this is not supported; I managed it by taking these steps before starting the GUI installer app:

  • installing the lvm2 package on the running system
  • creating an LVM-type partition on the system hard drive
  • creating a physical volume, a volume group and a root LV using the LVM tools. I also created a second LV for /var; this I don't think is relevant.
  • creating a filesystem (ext4) on each of the two LVs.

After taking these steps, the GUI installer offered the two LVs as installation targets; I gladly accepted, also putting /boot on a primary partition separate from the LVM partition.

Installation seemed to go smoothly, and I've verified that both the root and var volumes do contain acceptable-looking directory structures.

However, booting fails; if I understood correctly what happened, I was dropped into a busybox running in the initrd filesystem.

Although I haven't worked through the entirety of the grub2 docs yet, it looks like the entry that tries to boot my new system is correct:

menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos3)'
    search --no-floppy --fs-uuid --set $UUID_OF_BOOT_FILESYSTEM
    linux   /vmlinuz-2.6.35-22-generic root=/dev/mapper/$LVM_VOLUME_GROUP-root ro   quiet splash
    initrd  /initrd.img-2.6.35-22-generic
}

Note that $VARS are replaced in the actual grub.cfg with their corresponding values.

I rebooted back into the livecd and have unpacked the initrd image into a temp directory. It looks like the initrd image lacks LVM functionality. For example, if I'm reading /usr/share/initramfs-tools/hooks/lvm2 (installed with lvm2 on the livecd-booted system, not present on the installed one) correctly, an lvm executable should be situated in /sbin; that is not the case.

What's the best way to remedy this situation? I realize that it would be easier to just use the alternate install CD, which apparently supports LVM, but I don't want to wait for it to download and then have to reinstall.

© Ask Ubuntu or respective owner

Related posts about installation

Related posts about live-cd