Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was a bit of an idiot and wiped my old Ubuntu partition whilst in Windows XP, forgetting to fix the MBR. Rebooting gives:

error: no such partition.
grub rescue>

The only things I've entered that do anything are set, which gives:

prefix=(hd0,msdos5)/boot/grub
root=hd0,msdos5

and ls, which gives:

(hd0) (hd0,msdos2) (hd0,msdos1)

I have no CD drive so I can't boot from CD, but I should be able to boot from USB (haven't tested it as I need to go find one first). Is there anything I can do to fix it without external media, and if not how would I go about fixing it from USB?

share|improve this question
add comment

1 Answer

Try running these commands on the GRUB command line:

insmod part_msdos
insmod chain
set root=(hd0,msdos1)
chainloader (hd0,msdos1)+1

If that fails, try using msdos2 in place of msdos1.

If you get it to to boot that way, you'll have to do that every time until you replace that bootloader.

To fix it from a USB drive, you'd either need to use a Linux LiveUSB to reinstall GRUB (the easiest way being just to reinstall Linux, although it is possible just install a GRUB partition for bootloading), or copy a Windows XP install CD to a USB drive and make it bootable and use the Recovery Console in Windows Setup to replace the Windows bootloader.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.