[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HELP- Grub problem, I can't load WInXP



Andy wrote:
> 
> On Monday 26 September 2005 3:17, Dennis Stosberg wrote:
> > Windows XP is on /dev/hda, which is (hd0,0) in GRUB's notation.  So,
> > if you install the GRUB boot sector into /dev/hda1, you overwrite
> > Windows XP's boot sector in that partition.  That means you won't be
> > able to boot Windows XP at all, because GRUB will simply reload
> > itself when it tries to chain-load from (hd0,0).
> 
> Ah, didn't realise that, oops.
> 
> > What you probably wanted was to overwrite /dev/hda's MBR, which is
> > (hd0) in GRUB's notation with the GRUB boot loader.  So the BIOS
> > would start grub at (hd0), which in turn can chain-load Windows XP
> > from (hd0,0).  Or other systems/kernels from other devices.
> 
> Double oops.
> 
> > I'd suggest you to let the Windows XP setup restore the boot sector
> > of /dev/hda1 again.  After that you can reinstall GRUB to (hd0) and
> > _not_ to (hd0,0).
> 
> Well, I booted using the XP recovery console and have tried various fixmbr and
> fixboot commands but none of them brought windows back. So I've just
> installed grub again in hd0 to get an OS back.


Since your WinXP on /dev/hda1 is a FAT32 partition, one thing that might
work is to use the backup boot sector that is kept on FAT32 file systems
to restore the WinXP boot sector on /dev/hda1.

dd if=/dev/hda1 of=/dev/hda1 bs=512 count=1 skip=6 

The above dd command will read the 7th sector (or sector 6) of the
partition, and then write it to the 1st sector (or sector 0). The 7th
sector is where the backup boot sector is stored on FAT32. The "skip"
means it will skip over the first 6 sectors when reading from the
partition - since you are interested in the 7th sector.

GRUB should have only overwritten the 1st sector of the partition.

Tom



Reply to: