Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

November 27, 2005

It Never Rains

On top of a non functioning Mac I've now managed to bugger my work laptop.

I had it dual booted with Windows XP and Ubuntu but hadn't set my disk partitions properly. I wanted to move some space from the Ubuntu partition back to Windows but for one reason or another ended up deleting my whole ext3 partition. Which is fine because everything on it was backed up.

What it has done is confused my Grub configuration file. Whenever I start the machine I get grub error 22. So my question is this, oh great lazy web, how do I boot into Windows with a broken Grub installation sitting in my master boot record?

Oh, and it's a work machine so I don't have the windows Administrator password to run the XP recovery disk.

Update Following Ludo's advice in the comments - and from other parts of the intarweb - I got a Windows boot disk from Free Pc Tech Support, booted from it and fixed the master boot record (with fdisk /mbr). I can now boot into Windows XP and I'll reinstall Ubuntu after a suitable amount of sober reflection.

Posted by Andy Todd at November 27, 2005 07:42 PM


Get some Linux LiveCD, boot from it, chroot into your Linux, and regrub the MBR.

Posted by: Manuzhai on November 28, 2005 12:00 AM

As far as I know grub does not make a copy of the original boot sector - why don't you just reinstall Ubuntu?

Posted by: manni on November 28, 2005 01:00 AM

start a ubuntu live cd and in a terminal run grub and then:

root (hd0, >
# here you look for the partition that is mounted on
# /boot
setup (hd0) >

or you can rewrite your mbr with a windows 98 or 95 boot disk they work a lot like the windows xp mbr

Posted by: Leonardo Santagada on November 28, 2005 04:20 AM

Make a Windows boot floppy with fdisk on it, then boot and type

fdisk /mbr

Posted by: ludo on November 28, 2005 04:38 AM

When you finish reflecting on the perils of grub, reinstall with lilo and be done with it.

(the number of times I've been stuck with grub and ended up reinstalling a "rescue" lilo...)

Posted by: Nuno Souto on November 29, 2005 03:18 AM

Glad you managed to fix it.

If you have ten minutes to spare (you won't need more than that), read the grub docs. It looks complex, but it's *very* powerful and has saved my partitions more than once. Much, much better than lilo.

Posted by: ludo on December 4, 2005 07:59 AM