Mini-Howto: Restore Windows MBR/Bootloader with Linux

August 26, 2009

I’m often, at least more than I care, asked how to restore a Windows MBR/bootloader without having a windows install cd or a dos boot disk at hand. It’s quite easy you need just a Linux live cd like (the Ubuntu live cd or Knoppix) or an installed Linux you want get rid of. I really don’t know why you want to do the second, but anyway here are the 2 solutions I know of.

Boot Linux and make sure you’ve a working Internet connection and type following on the terminal/konsole.

1. Solution


sudo apt-get install syslinux

if the package got installed use following to write the MBR.


sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda

2. Solution


sudo apt-get install mbr

if the package got installed use following to write the MBR.


sudo install-mbr -i n -p D -t 0 /dev/sda

Common for both

Replace sda if you want to install the MBR to a different drive. Take a look at your hard disks with sudo fdisk -l if you’re unsure. Finally reboot and your windows should boot.

2 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Thank you, thank you , thank you! I tried Ubuntu, could not get anything to start w/o the live CD, couldn’t get to Windows. Tried the beginner forum, got some input that didn’t work, but somewhere in there was the link to your page. It worked like a charm. I am done experimenting.

    Comment by Dave — December 9, 2009 #

  2. thanks so much for sharing. it’s so difficult nowadays to find in the great amount of resources emerging every day smth that is worth my attention. you helped me a lot:)

    Comment by Mike Hunter — March 2, 2010 #

Leave a comment

*
To prove that you're not a bot, enter this code
Anti-Spam Image

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress
Entries and comments feeds. Valid XHTML and CSS. 24 queries. 0.048 seconds.