Comment 3 for bug 716865

Revision history for this message
Colin Watson (cjwatson) wrote :

This is happening because some proprietary software on your system is unwisely using the boot track to make it difficult for you to uninstall it cleanly. You should find out which and complain about this shady practice; it's poor engineering and it causes conflicts with other software. I wrote about this (from a different angle, but it's the same underlying problem) here:

  http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/debian/2010-08-28-windows-applications-making-grub2-unbootable.html

However, it should be possible for us to work around it in GRUB, and I would like to do so. Please follow these instructions:

 * Save the output of 'sudo fdisk -lu' to a file. In this output, take note of the start sector of the first partition (usually 63, but might also be 2048 on recent installations, or occasionally something else). If this is something other than 63, then replace 63 in the following items with your number.
 * Save the contents of the boot track to a file (replace /dev/sda with your disk device if it's something else): 'sudo dd if=/dev/sda of=sda.1 count=63'
 * Run 'sudo dpkg-reconfigure -phigh grub-pc', and just press Enter (accept the default) in response to all questions. This should "corrupt" the Windows partition again. Now save the new contents of the boot track to a different file: 'sudo dd if=/dev/sda of=sda.2 count=63'
 * Attach these three files to this bug (the output of 'sudo fdisk -lu', and the boot track before and after making GRUB unbootable).

You don't need to recover the whole system from backups after this; just run:

  sudo dd if=sda.1 of=/dev/sda count=63 conv=notrunc

(again replacing /dev/sda and 63 with the real values, as above). Be careful when typing this as it will be writing to the boot track of your hard disk.