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.
6 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress
Entries and comments feeds.
Valid XHTML and CSS.
18 queries. 0.074 seconds.
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 #
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 #
It worked like a charm. I am done experimenting.
Comment by labatterie — April 27, 2010 #
It’s THAT SIMPLE????
[tries it]
THANK YOU! THANK YOU! THANK YOU! THANK YOU!
WINDOWS BOOTS AGAIN!!!!!
THANK YOU! THANK YOU! THANK YOU! THANK YOU!
[prints out the instructions and adds it to the “Important Computer Stuff” folder.
Comment by Fred Doolie — June 27, 2010 #
I OTOH am not done experimenting at all!. Now that I know how to re-windowize my system from a total Linux install I’m free to play around a lot more. The restore CDs that came with the system don’t restore the MBR; only the OS. In other words Grub is still in the MBR. I even tried using gparted to totally wipe the drive as if it was a new clean HDD. Windows partitioned the drive and installed but kept rebooting since there was no MBR info. Your little trick added that and now it”s all good!
Comment by Fred Doolie — June 27, 2010 #
Now that I know how to re-windowize my system from a total Linux install I’m free to play around a lot more.
Comment by batterie — June 29, 2010 #