How to restore Windows 7 MBR without a CD

install Ubuntu LiveCD on your pendrive, boot from your pendrive, open terminal and type:

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

Replace /dev/sda with the name of your drive.

What parameters do (from man page):

--interrupt <mode>, -i <mode>

This option sets the list of events which will cause the MBR to display it's prompt. Use -i +<event> to add an event to the list or -i -<event> to remove an event from the list. Values of <event> are:

  • s – A shift or control key is pressed.
  • k – A non shift-like key is pressed
  • a – The prompt is always displayed.
  • n – Never display the prompt (unless an error occurs).

-p <partn>, --partition <partn>

This specifies the default boot sector to load. Valid values of <partn> are:

  • 1, 2, 3, 4 The specified partition number.
  • F The first floppy disk.
  • D The partition marked with the bootable flag in the partition table.

-t <timeout>, --timeout <timeout> This option changes the time which the MBR waits for before booting the default partition to the value specified in 1/18 seconds (approx). The maximum timeout that can be specified is 65534 which is about an hour.

If mbr not on repo you can download the Deb package from here.

Another method:

sudo apt-get install syslinux
sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda

You may download the Boot-repair Disk iso images and burn it to a USB stick. Then, boot the stick and repair the MBR on the defected hard disk as you like. Both 32-bit and 64-bit versions are available.

enter image description here

It really works, I use it to repair a Win7 disk which MBR was accidentally over written by GRUB during the installation of Debian.


Consider Super Grub Disc as a solution. You can put it on your pendrive with Unetbootin and boot to your pendrive. Select Windows and then Fix boot of Windows to restore your Widows MBR(no Ubuntu access with this potion) or GNU/Linux followed by the Fix Boot option(If you want both Ubuntu and Windows). You may then reboot and get access to your OS's(depending on your choice, you may only get the Windows MBR). Note that although Super Grub Disk is outdated, Super Grub Disk 2 does not work, and so you should use Super Grub Disk.