Bug#591416: This bug might be due to Windows programs overwriting grub

Colin Watson cjwatson at debian.org
Wed Sep 1 08:13:19 UTC 2010


On Wed, Sep 01, 2010 at 08:33:38AM +0200, Svante Signell wrote:
> On Tue, 2010-08-31 at 18:48 +0100, Colin Watson wrote:
> >  * Do whatever you do to make GRUB unbootable (presumably starting
> >    Windows), then boot into a recovery environment.  Before you
> >    reinstall GRUB, save the new contents of the embedding area to a
> >    different file: 'dd if=/dev/sda of=sda.2 count=63'
> 
> Here I will potentially get into problems. In case grub won't boot I
> need a Netboot or complete CD to recover grub. When running the Debian
> installation CDs even choosing recovery gives you a lot of choices
> before getting into a shell. Which CD to burn when running unstable? Is
> it written somewhere how to reach the recovery shell. What to do then:
> grub-install and update-grub2? What about install-mbr? 

In the following instructions, I will assume that your root file system
is on /dev/ROOT (a real example might be "/dev/sda1"), and that GRUB is
installed on /dev/GRUB (a real example might be "/dev/sda").  Please
check this before following these instructions, and replace with the
appropriate device names.

The Squeeze Alpha1 netinst CD should be fine for this:

  i386:  http://cdimage.debian.org/cdimage/squeeze_di_alpha1/i386/iso-cd/debian-testing-i386-netinst.iso
  amd64: http://cdimage.debian.org/cdimage/squeeze_di_alpha1/amd64/iso-cd/debian-testing-amd64-netinst.iso

Select "Rescue mode" when booting the CD, then run through the
installation system (which should say "Rescue mode" at the top left of
each screen) until it asks you which partition to use as your root file
system (if it prompts you to create or edit partitions, then you
selected the wrong thing when booting the CD; reboot and try again).
Select /dev/ROOT, then select "Execute a shell in /dev/ROOT".

In this shell, run 'grub-install /dev/GRUB'.  You do not need to run
update-grub (grub.cfg has not been touched), and you should not run
install-mbr (GRUB installs its own MBR).

I suggest that you perform a test run through this before doing whatever
you do to make GRUB unbootable.

-- 
Colin Watson                                       [cjwatson at debian.org]





More information about the Pkg-grub-devel mailing list