mirror of https://github.com/sipwise/netscript.git
Since lvm2 v2.02.106 its udev rule creates a /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for PVs: https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=417e52c13a8156b11c25c411d44bda8b32bf87e4 When debootstrapping Debian/wheezy to a virtio disk from a system using lvm2 >=v2.02.106 (as present in Grml >=2014.11) this causes the resulting GRUB installation to look like that (`/media/ngcp-root` is the mounted logical volume with the rootfs which also includes /boot): | root@grml ~ # cat /media/ngcp-root/boot/grub/device.map | (hd0) /dev/disk/by-id/lvm-pv-uuid-RNZHr8-hLlc-nles-X9Gs-RYSp-Mqo7-uZTk6N | (hd1) /dev/vda and failing to boot with: > error: no such disk > Entering rescue mode... > grub rescue> When manually removing the lvm-pv-uuid* symlink from the Debian/jessie system before installing GRUB it works fine: | root@grml ~ # rm /dev/disk/by-id/lvm-pv-uuid-RNZHr8-hLlc-nles-X9Gs-RYSp-Mqo7-uZTk6N | root@grml ~ # ls /dev/disk/by-id | ata-QEMU_DVD-ROM_QM00003@ dm-name-ngcp-swap@ dm-uuid-LVM-lQhnvLyYmhESObLrZcnJs4FTZq9usVDzRex3ImRtrmqhpDH9xKBj22St82lHDADh@ | dm-name-ngcp-root@ dm-uuid-LVM-lQhnvLyYmhESObLrZcnJs4FTZq9usVDzrcMaDfk8O0RionEYRxdjnYxsY6eb0Esi@ | root@grml ~ # grml-chroot /media/ngcp-root/ grub-install --recheck /dev/vda # `grml-chroot` makes sure /proc, /sysfs and /dev are properly mounted in the chroot | Writing /etc/debian_chroot ... | Installation finished. No error reported. | root@grml ~ # cat /media/ngcp-root/boot/grub/device.map | (hd0) /dev/vda NOTE: This problem seems to exist only for virtio disks, when using a disk on the SATA bus the resulting device.map of the Debian/wheezy system looks like that and boots fine: | root@grml ~ # cat /media/vg0-root/boot/grub/device.map | (hd0) /dev/disk/by-id/ata-QEMU_HARDDISK_QM00005 | (hd1) /dev/disk/by-id/lvm-pv-uuid-lJJr4E-M96R-3eIS-b6YO-5usn-bH5o-osQV2B As a result check for Debian wheezy (or older) and if the disk is a virtio one (AKA /dev/vda), if so then remove the symlink of the live system before installing Debian incl. GRUB via grml-debootstrap. Reported as https://bugs.debian.org/782998 in Debian's BTS. Change-Id: I4b2cf9e39c88521ab7eac7799531508e658cc30dchanges/07/1707/3
parent
e5664d5850
commit
7340bf211c
Loading…
Reference in new issue