shadow

Repair XP MBR with only an Ubuntu Live CD

I just deleted and 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.

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;
    It downloaded, then gave me a prompt box which required me to hit enter before it installed Lilo.  There were 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. type “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 harddrives go.

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

14 Comments

  • rodrigo

    31 July 2010 at 14:20

    finally!

  • Enrique

    2 November 2010 at 20:41

    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!

  • njetpopcorn

    8 November 2010 at 04:11

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

    This made my day 😀

  • Sonsum

    22 November 2010 at 17:50

    This worked amazing! Thank you!

  • 1Earth

    22 November 2010 at 18:12

    I'm glad it worked for you guys too.

    @Enrique – OK, this is not the solution, but using this thread (especially CalJohnSmith's 12 Aug 2008 reply), it will give you enough info to search for the Windows solution to your problem.

    http://ubuntuforums.org/showthread.php?t=887895

  • Paul

    18 December 2010 at 00:12

    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!

  • Vj

    17 February 2011 at 17:27

    Awsome fix! Great work around if you don't have an XP recovery disc at hand.

  • vince

    13 July 2011 at 11:39

    many many thanks,

    this worked a treat.

  • heriz

    3 September 2011 at 06:23

    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

  • 1Earth

    3 September 2011 at 08:48

    Hi, I don't know exactly what's wrong – but I can imagine it won't be horribly hard to fix.

    Here's the Google Results for the error you're getting. Start there, the solution will be in there somewhere.

  • Spring Pisith Thanasaethsakul

    27 November 2011 at 16:57

    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

  • Bhabani

    23 December 2011 at 03:38

    thanx alot it saved me from formatting my system

  • micha

    23 August 2012 at 17:31

    great instruction & very easy (Y) Thumbs up and thx dude

  • Ato Koomson

    2 August 2013 at 02:32

    Thank you so Much you are the best person ever.

Post a Comment

%d bloggers like this: