LVM boot issue on Debian Linux with initramfs-tools

Uncategorized , , 0 Comments

Although the format /dev/[vg_name]/[lv_name] format is easier to read when you got plenty of VGs (compared to /dev/mapper/[vg_name]-[lv_name]), it won’t work at boot.

This is the few lines of default initramfs script which is responsible for the behaviour described above:
/usr/share/initramfs-tools/scripts/local-top, from line 40:

# Make sure that we have a d-m path
vg=${vg#/dev/mapper/}
if [ "$vg" = "$1" ]; then
    return 1
fi

And it wouldn’t be enough to remove this check, because there is an another one for the format:

# Make sure that the device includes at least one dash
if [ "$(echo -n "$vg" | tr -d -)" = "$vg" ]; then
    return 1
fi

So you have to use the /dev/mapper/[vg_name]-[lv_name] format in GRUB’s menu.lst (or LILO’s lilo.conf) to boot from an LVM device. Unless you change the script above, of course 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.