Booting Debian with root (/) on LVM2

So I got 2 new pc’s recently. One was a complete reinstall job, playing with the new Debian Etch installer. Unfortunately the kernel it came with was too old to support lvm at boot time, so even though I installed initramfs-tools it would not find my root partition in lvm. I had to use a rescue disk to upgrade to a newer kernel and initramfs-tools.

My other box was far more fun. I tried to move it to LVM. I made a copied the data from / into my new LVM root partiton, rebooted and found that I could not boot off LVM. Installing initramfs-tools and a newer kernel worked, but then I tried to resize my old partition smaller and make it just a boot partition, which killed grub. So a boot disk came back and I had to reinstall grub, which was full of hassle.

I do have both working now, so with a bit of effort it is possible.

About Anton Piatek

Professional bit herder, amateur photographer. Linux and tech geek
This entry was posted in Debian. Bookmark the permalink.

One Response to Booting Debian with root (/) on LVM2

  1. Maitre says:

    It took me a bit of poking around too, to get things going. (Obviously your post got me started on the right track, though!) In particular, what seemed to be missing from the default setup, is the part of the boot scripts in the initramfs-tools that starts up LVM. I needed to copy that over to get everything working, i.e.:

    cp /usr/share/initramfs-tools/scripts/local-top/lvm /etc/mkinitrd/scripts/

    Once done, running mkinitrd (or installing a new kernel image) would generate an initrd image that would successfully boot a LVM filesystem. Hope that helps anyone else who gets stuck like I did.

Leave a Reply