[Bug 557144] Re: update-grub2 does not honor the right boot device
Thomas Schweikle
557144 at bugs.launchpad.net
Sun Nov 2 08:51:44 UTC 2014
** Changed in: grub2 (Ubuntu)
Status: New => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/557144
Title:
update-grub2 does not honor the right boot device
Status in “grub2” package in Ubuntu:
Fix Released
Bug description:
Assume grub installed on its own partition, the kernel and initrd in "/boot". fstab looks like:
<pre>
UUID=cd4782ce-cbe5-46bb-a1ca-0ef613d65be1 / ext4 errors=remount-ro 0 1
UUID=ffa76c51-70ca-4557-ac26-798e64ff9502 /boot/grub ext3 errors=remount-ro 0 2
</pre>
update-grub now generates:
<pre>
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, mit Linux 2.6.32-19-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ffa76c51-70ca-4557-ac26-798e64ff9502
linux /vmlinuz-2.6.32-19-generic root=UUID=cd4782ce-cbe5-46bb-a1ca-0ef613d65be1 ro quiet splash
initrd /initrd.img-2.6.32-19-generic
}
menuentry "Ubuntu, mit Linux 2.6.32-19-generic (Wiederherstellungsmodus)" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ffa76c51-70ca-4557-ac26-798e64ff9502
echo Linux 2.6.32-19-generic wird geladen …
linux /vmlinuz-2.6.32-19-generic root=UUID=cd4782ce-cbe5-46bb-a1ca-0ef613d65be1 ro single
echo Initiale Ramdisk wird geladen …
initrd /initrd.img-2.6.32-19-generic
}
### END /etc/grub.d/10_linux ###
</pre>
The UUID of the grub-partition is used to set the root device, leading
to error "File not found. You must load a kernel first..." while
booting. update-grub should have instead used UUID of the partition
kernel and initrd are on.
The relevant part is in "/etc/grub.d/10_linux":
<pre>
50 if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
51 || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
52 || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then
53 LINUX_ROOT_DEVICE=${GRUB_DEVICE}
54 else
55 LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
56 fi
</pre>
This code should not refer to GRUB_DEVICE_UUID. It should refer to
KERNEL_DEVICE_UUID instead.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/557144/+subscriptions
More information about the foundations-bugs
mailing list