Repair XP MBR with only an Ubuntu Live CD

I just deleted an old Ubuntu off the Journo’s dual-boot Ubuntu/XP HP Pavillion, and along with it Ubuntu’s Grub and her Master Boot Record (MBR), which of course rendered the machine useless. Sigh.

I had an Ubuntu 10.04 Lycid Lynx Live CD at hand (never leave home without it), so here’s how to repair an XP MBR with only an Ubuntu Live CD.

Repairing XP MBR with Ubuntu Live DC

It’s actually ridiculously easy:

  1. Boot from the Live CD, and into Ubuntu (it’s option 1, Try Ubuntu Without Making Any Changes to your Computer);
  2. Once you’re in the OS, from the menu choose Applications -> Accessories -> Terminal;
  3. In the Terminal Window type “sudo apt-get install lilo“, which is a Linux gadget that will fix your woes;
    Once downloaded, you’ll get a prompt box which requires you to hit enter before it installs Lilo.  I got some warnings telling me to do something otherwise the computer might not work. The computer wasn’t working anyway, so I ignored those warnings and…
  4. typed “sudo lilo -M /dev/sda mbr“;
  5. Done. Reboot.

The above assumes a straight forward flub with the Master Boot Record, and a default setup as far as hard drives go.

I rebooted the PC and voila! it booted straight back in to Windows XP.

Published by Yaku

Yaku is a brewer, baker, and semi-retired trouble maker (semi-retired from trouble-making that is). Although he believes anything is possible, he is nevertheless frequently stupefied by his world and the people in it.

14 thoughts on “Repair XP MBR with only an Ubuntu Live CD

  1. Hi, hey man, great work… I had this issue and I had found many solutions that required installing ms-sys, but a couldn't got it to install with ubuntu 10.10 live, but this lilo thing worked great.

    Just one thing, you see, when I turn on my pc, at some point it displays "no active partition" or something like that, obviusly is because lilo is trying to boot or is looking for some partition to boot from, do you know how to remove that?, anyways that message didn't even last that long, so if you don't know, or requieres to much work, it doesn't really worth it :O

    Thanks!

  2. Yeah, I agree finally! Been trying to use the ms-sys package, until I realized it didn't exist anymore 🙁

    This made my day 😀

  3. I'm a foolish newbie and fouled up my Win MBR on my work laptop while goofing around with Ubuntu. Thanks a million for this… you saved me!

  4. saya selalu menggunakan 2 os : windows xp dan ubuntu 11.04

    tetapi windows

    saya rusak dan harus di install ulang, saya melakukan instal ulang dan menyebabkan bootloader ubuntu saya tertimpa dan hilang.. kemudian saya menggunakan cd ubuntu untuk memperbaiki bootloader saya dan kemudian berhasil bootloader saya pun kembali seperti semula..

    namun yg saya bingung saya tidak bisa boot untuk masuk ke windows xp?

    tolong bantu saya agar bisa masuk boot untuk ke dua-duanya???

    terimakasih

    ini tampilan saat masuk ke w xp:

    error: no suce device: DE6CCF186CCEEA7B.

    error: device format “/devsda,msdos1″ invalid: must be (f|h) dN, with 0

    <=N< 128.

    error: no such disk.

    Tekan tombol apapun untuk melanjutkan…

    saya tekan tombol ga bisa2 masuk

    mohon dibantu ya

  5. Hi thank you very much for this article i follow all your instructions and everything seems to be fine but after i reboot my computer i still can not use my windows. it show that
    ——————————————————————————————–
    Windows failed to start.A recent hardware or software change might be the cause. to fix the problem:
    1. insert your windows installation disc and restart your computer.
    2. choose your language setting, and then click "next."
    3. Click "Repair your computer."

    if you do not have this disc, contact your system administrator or manufacturer for assistance.

    File: BootBCD
    Status : 0xcooooo98
    Info: The windows Boot Configuration Data file dose not contain valid os entry.
    ——————————————————————————————–
    before i got this problem i just delete Linux partition in windows 7 and another Partition (i cont remember which one because i click it unintentionally hope that it is not windows partition).before that i already use EasyBCD to set the mbr already.

    sorry for my long psot i really need to use my com to finish my project

    thank you very much

Leave a Reply

%d bloggers like this: