1

While following instructions from this page I accidentally deleted the MBR. I do however still have a backup of the MBR. I tried to resore it using the following command

$dd if=MBR-backup of=/dev/hdx bs=512 count=1

Unfortunately the output from this command is opening ‘MBR-backup’: No such file or directory

Does anyone know how to restore my MBR-backup?

user218800
  • 13
  • 1
  • 5
  • Possible Duplicate? http://askubuntu.com/questions/326532/how-to-fix-the-mbr-for-windows-7/326564#326564 – Mitch Nov 24 '13 at 09:10

1 Answers1

0

I have the same issue, because of a little failure on installing ubuntu. The error was: when I would access Windows 7, then I go return to the grub window.

To solve this, i have write the Grub in the right MBR, and write the bootloader from windows new:

Write Grub to right MBR

Please mention that If you boot into ubuntu os then run this and this commands on terminal. If you not able to boot into ubuntu os, then boot a ubuntu live disk then run this and this commands on terminal:

  1. Installing Grub in the right MBR

    sudo grub-install /dev/sda
    

    Info: Only If the system is installed on /dev/sda, otherwise use the right harddrive like /dev/sdb

  2. Update Grup

    sudo update-grub
    

Restoring Windows Bootloader

  1. Restarting Computer with Windows 7 installation dvd

  2. Go to the windows console (under point computer repair)

  3. Reinstall Windows bootloader in terminal

    bootrec /fixboot
    
  4. Reboot computer

pointhi
  • 148
  • 6
  • where would we run `sudo grub-install /dev/sda` `sudo update-grub` commands. – Avinash Raj Nov 24 '13 at 10:15
  • In the linux console, it install the grub on the right harddrive and update it. – pointhi Nov 24 '13 at 10:18
  • plz mention that. – Avinash Raj Nov 24 '13 at 10:20
  • plz mention that If you boot into ubuntu os then run this and this commands on terminal.If you not able to boot into ubuntu os,then boot a ubuntu live disk then run this and this commands on terminal.Please give a clear-cut explanation. – Avinash Raj Nov 24 '13 at 10:33
  • why are you paste my comment,i help you to how to write an answer. – Avinash Raj Nov 24 '13 at 10:48
  • sorry, I have think you you gave me a piece text to improve the answere. – pointhi Nov 24 '13 at 10:51
  • But now when i want to boot the pc with usb, it show "invalid partition table" – user218800 Nov 24 '13 at 14:26
  • I have to say that i not install the ubuntu yet, and from now i cannot booot windows 7 because i blank out the MBR, and even now i want to boot windows PE by usb(carry a diskgenius, i decided to rewrite MBR by using this),it show me "invalid partition table" – user218800 Nov 24 '13 at 14:31
  • ok, this instructions are for grub, when you only have windows, you must start the computer with a windows dvd, go to the comand promp and enter: `bootrec /fixmbr` to make a new compatible mbr and then type `bootrec /fixboot` to install the bootloader. – pointhi Nov 24 '13 at 15:06
  • [here](http://translate.google.at/translate?sl=de&tl=en&prev=_t&hl=de&ie=UTF-8&u=http://www.patrick-gotthard.de/808/bootsektor-und-bootloader-von-windows-7-wiederherstellen&act=url) is a good guide to do that (auto translated from german to english) – pointhi Nov 24 '13 at 15:09
  • Is this method can bring back the windows and my files? – user218800 Nov 25 '13 at 10:34
  • I mean i got many documents on there – user218800 Nov 25 '13 at 10:34
  • yes, if only the mbr is corrupted. `dd`, the tool with you use to modified the mbr is a very powerful system, which can easily delete a whole hard drives. – pointhi Nov 25 '13 at 17:56
  • But it say" invalid partition table" is this gonna affect the hard drives? – user218800 Nov 25 '13 at 23:20
  • the [partiton table](http://en.wikipedia.org/wiki/Partition_table) is on the harddrive. When you found your windows installation with the windows dvd, the table is presumably correct. If not, you must restore it. – pointhi Nov 26 '13 at 11:59
  • THX, I will try now – user218800 Nov 26 '13 at 12:57
  • Wait , when i boot with disc , do the way" bootrec / fixmbr "and " bootrec / fixboot" . when i restart it still error, now i click the top one "system startup repair" – user218800 Nov 26 '13 at 13:21
  • And now it just keep show the page like the link u guide me before when i restart – user218800 Nov 26 '13 at 13:24
  • I think, the best is using a windows forum for that. The people there have more knowlege about windows problems. – pointhi Nov 27 '13 at 12:47
  • Never mind, i solved my problem. Thx for helping. – user218800 Nov 29 '13 at 01:45