Restore Windows MBR Bootloader using Linux

30 Mar

So i had someone that brought me their little laptop that they had experimented with linuxmint and decided to just use windows. They were dual booting and they had someone remove the linux partitions. Well that messed up grub and the laptop would no longer boot. I really don't know why they decided not to use Linux, however i said i would fix it so they could boot into windows. I have only fixed grub boot issues and not any for just windows. So i spent some time searching the internet  trying to figure out how to fix this. Well after a few hours i found a simple command. I am posting my finding here because as i have said before it's easier for me to search my own site than the internet.


So to restore you windows bootmanager you can run a simple command. I found this on Robert Penz Blog and it was so easy i really didn't think it would work. However this did work and the user was very happy to have his laptop booting again.  (even if it is into windows) You will want to have the syslinux package installed. The linuxmint boot usb stick he had for me already had the tools so it was easy to work with.

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

And that's it. You will now have your machine booting again. There was a second 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

I did not need to use this however so your mileage may vary.

Leave a Reply


Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code,samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>