[Bug 496435] Re: upgrades of the grub-pc package can overwrite wrong MBR

Leo Milano lmilano at gmx.net
Sat Nov 5 19:48:03 UTC 2011


This is still an issue in Oneiric. Here is my case:

* a computer with two hard-drives. One of the MBR of these is used to bottup normally
* I introduced a USB stick with Kubuntu 11.04,  booted from USB, and upgraded to Oneiric (11.10)

After the upgrade,  the MBR in the HD of the desktop computer was now
damaged, it would no longer boot from HD

The fix was, as usual, to boot the HD partition from the USB's Grub, and
then run grub-install /dev/sdX , where X was the appropriate value
(either a or b).

-- 
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/496435

Title:
  upgrades of the grub-pc package can overwrite wrong MBR

Status in “grub2” package in Ubuntu:
  Fix Released
Status in “grub2” package in Debian:
  Fix Released

Bug description:
  Binary package hint: grub2

  The grub-pc package calls grub-install on upgrades. The drive to
  install to is stored in debconf as a string like "/dev/sdb". The
  problem is that /dev/sdb won't always be the same device if drives are
  moved around or, where the situation is particularly bad, when Ubuntu
  is installed to an external drive and used on multiple computers as a
  "live" system. For this reason everywhere else in Ubuntu I can think
  of file systems are specified with UUIDs rather than device names. For
  specifying drives, /dev/disk/by-id/ seems to give a unique way to
  identify a disk. grub-pc should store something like "/dev/disk/by-id
  /usb-OEI-USB2_Ultra_Disk_Drive_090706000466-0:0" instead of "/dev/sdb"
  so there is no chance of installing to the wrong disk on grub-pc
  upgrades.

  As an example: If you install Ubuntu to an external USB drive on
  computer that has only one internal drive then grub-pc/install_devices
  will likely contain "/dev/sdb". If you then boot from that external on
  another computer that has an OS installed on its second internal
  drive, an upgrade of the grub-pc package would install to /dev/sdb
  making that computer unbootable.

  Work Around: If you install Ubuntu to an external drive and plan to
  use it on multiple computers run "sudo dpkg-reconfigure grub-pc" and
  uncheck all drives when prompted for "GRUB install devices". You will
  need to manually run grub-install to the correct drive before any
  major upgrades.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/496435/+subscriptions




More information about the foundations-bugs mailing list