LVM boot issue on Debian Linux with initramfs-tools

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 :)

This entry was written by kakaopor , posted on Thursday February 11 2010at 09:02 am , filed under Uncategorized and tagged , , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Leave a Reply

i
north-supercharged