Bug#595340: grub-pc: upgrade-from-grub-legacy can make system unbootable

Vincent McIntyre vincent.mcintyre at csiro.au
Mon Sep 6 05:49:55 UTC 2010


This turned out to be a problem with one of the other disks in the system.

The first disk in the chassis, which is enumerated as /dev/sda,
contains a Dell utility partition. This uses linux under the hood,
and of course has a GRUB setup in the MBR.

I was working with the second disk in the chassis (enumerated as /dev/sdb).

The tests that showed this were as follows.
 - remove all disks except the intended boot disk (sdb).
   power up, I see 'Welcome to GRUB!' and the correct grub menu loads.
   system boots ok.
   power down.
 - start adding the other disks back one at a time, boots every time.
 - add the disk with the Dell utilities (sda).
   power up, grub fails with 'Error 15'.
   power down.
 - remove the disk with the Dell utilities.
   power up, I see 'Welcome to GRUB!' and the correct grub menu loads.
 - I checked the MBR of the sda disk with dd if=/dev/sda bs=512 | od -c.
   This shows GRUB installed on the MBR of the disk. I didn't put it there.

It appears that upgrade-grub-from-legacy was getting confused, somehow,
by the two grub signatures in the MBRs.

So I'm not sure if this is still a bug in grub-pc, or a 'feature'.
I'll wait for the maintainer's opinion on that.

I am surprised grub-install did not detect and warn about the grub signature
on the other disk, particularly as it was earlier in the enumeration order.

The signature on sdb should definitely have been grub2.
I couldn't tell if the signature on sda was grub1.
How would one tell them apart?

I am guessing upgrade-grub-from-legacy does not check for grub1 signatures
on all disks in the system, but just updates the first one it finds, or
just the one mentioned in /boot/grub/grub.cfg.
It would be more robust to check all the disks, if this is possible,
and warn the user if more than one signature is found.

My thanks to Zoltan Herman for pointing me in the right direction
by private mail.

-- 





More information about the Pkg-grub-devel mailing list