update to grub-pc writes MBR without checks, prompt or backup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: grub
Booted laptop from external USB HDD containing Karmic.
Installed updates. One of the updates is to grub.
Internal drive contains a full-disk encrypted Windows installation.
Update to grub writes the grub MBR to the internal disk, instead of the disk that grub booted the original MBR from.
On a standard Windows install I would have considered this merely annoying, because I could have replaced the MBR easily enough. On this install I have to get one of the support techs to "bless" the disk with a special bootloader and the "Code of the Day".
This is a more general case of #112239 "GRUB writes to wrong MBR and destroys RAID setup"
Suggestions ;
- Where multiple disks present, always prompt the user for the disk to put the MBR on. This would help prevent these problems
- Make the prompt nice and clear, disk descriptors, sizes, etc
- When UPDATING grub, only write the MBR to a disk that has a recognized grub MBR on it already.
- It's not an "install" (and be damned), it's an update
- Whenever you write any MBR, write the previous MBR data to a permanent log file. This way it can be restored afterwards.
affects: | grub (Ubuntu) → grub2 (Ubuntu) |
tags: | added: grub2 mbr trucrypt update |
Changed in grub2 (Ubuntu): | |
status: | Confirmed → Fix Released |
Found the bit of the apt log.
Oh, I'd rate this as "Critical" in terms of importance (although I'm biased). Things that are "routine" system updates should never do potentially system-wrecking things. I felt slightly weird whenever I saw that "beta" version moniker on the boot screen.. and now I know why.
===================
Setting up grub-pc (1.97~beta4- 1ubuntu4. 1) ... device. map.
Installation finished. No error reported.
This is the contents of the device map /boot/grub/
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda 2.6.31- 16-generic img-2.6. 31-16-generic 2.6.31- 15-generic img-2.6. 31-15-generic 2.6.31- 14-generic img-2.6. 31-14-generic +.bin
(hd1) /dev/sdb
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found memtest86+ image: /boot/memtest86
done