How do I restore my Master Boot Record?

12

2

I have installed Autocad 2011 trial on my system and then I found out that Autocad Changes the MBR. (see here) Now I want to restore my MBR to before last time of installing autocad 2011 trial (in fact to original MBR). How can I do that? Please be specific, I'm not a pro hardware technician.

i'm using windows 7 Home.

qiback

Posted 2011-05-08T11:33:19.983

Reputation:

12Wow, a piece of software modifies your MBR? I'd immediately uninstall it, format my drive, and demand a full refund. – Cody Gray – 2011-05-08T11:37:57.007

4Solution to all that kind of software - virtualization. As in the old days anecdote about MS, don`t even give it a chance. – Bakudan – 2011-05-08T11:46:15.293

I've gotta say I agree with @Cody Gray 100%. – boehj – 2011-05-08T11:51:01.913

What MS Windows version are you running? There are plenty of questions on recovering the MBR: WinXP, WinVista and Win7.

– Lekensteyn – 2011-05-08T14:29:49.850

hi i'm original poster. i cant leave comment on posts (i dont know why). so ... my computer is a laptop (Sony Vaio F134/FX) and it has original MS Windows and i hav'nt access to windows install media. – qiback – 2011-05-08T13:28:20.557

@qiback Register both SO and SU accounts with same OpenID. Gain back question. – random – 2011-05-08T17:46:12.373

Answers

8

For this problem it's not actually an issue with the MBR. The AudoCAD forums you linked to had the following info:

It's not a change in MBR. grub bootloader put it's stage2 code into the 2048 sectors after the master boot record. this harddisk area is not used by operating systems and resides before the first partion. between byte 3585 (0x0E01) and byte 4096 (0x1000) autocad 2011 write some code in this area and destroy the grub boot stage2 code.

You're going to need to reinstall GRUB. According to the Super GRUB Disk Wiki, you can fix GRUB from within a Linux install if you use a LiveCD, or from the GRUB command prompt if you can get to stage 1, or by using said Super GRUB Disk to repair the bootloader. Depending on your version of GRUB, there are different choices for which recovery disk you should use; you can see them all here.

If you have access to stage 1 of the loader, use the following commands:

Find the partition where GRUB stage1 it is.

grub>find /boot/grub/stage1
grub>find /grub/stage1
Output from these commands might be:
  (hd0,1)
  (hd0,3)

Let's suppose that you want to restore GRUB from second partition on first hard disk, (hd0,1).

Just type these commands:

grub>root (hd0,1)

which prompts:

Filesystem type is ext2fs, partition type 0x83

and then:

grub>setup (hd0)

which prompts:

Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists...

yes Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 15 sectors are embedded. succeeded Running "install /boot/grub/stage1 d (hd0) (hd0)1+15 p (hd0,1)/boot/grub/stage 2 /boot/grub/menu.lst"... succeeded Done.

Now you can reboot your machine with the reboot command.

grub>reboot

nhinkle

Posted 2011-05-08T11:33:19.983

Reputation: 35 057

2

Before you do this, make sure you back-up your valuable data.

One potential solution to your problem is to use the Windows install media to try and repair the MBR. Put the DVD in the drive and it will guide you to an option to repair the install.

CODA

The other option is to grab a Super Grub .iso, burn it, and use that instead. It can repair broken MBRs.

boehj

Posted 2011-05-08T11:33:19.983

Reputation: 1 042

2

According to your link, AutoCad 2011 doesn't modify the MBR, but instead modifies the 2K bytes that follow it (which are usually unused, except by GRUB) therefore you need to reinstall Grub rather than restore the MBR. In any case, since it is an important question I will address what you actually asked - restoring MBR.

By Far the Easiest and quickest way to backup/restore the MBR is to use a linux live-cd and dd.

Simply boot into the livecd and perform:

dd if=/dev/sda of=MBR.bak bs=512 count=1

restore using the same command but with flipped of and if

dd if=MBR.bak of=/dev/sda

Make sure that /dev/sda refers to your primary hard drive, there is no need to specify blocksize and count since MBR.bak is 512 bytes already - NOTE THAT THIS WILL OVERWRITE YOUR PARTITION TABLE - avoid doing so by selecting bs=446 count=1 on the restore (last 66 bytes of the MBR is the table + signature)

To backup and restore the part that AutoCad overwrite replace count with 5 (to cover the first 512 and the 2k following it). Assuming of course that you did this prior to installing AutoCad. Although as Cody pointed out - any piece of software PARTICULARLY A TRIAL VERSION that modifies your hardisk on such a low level should be removed immediately

crasic

Posted 2011-05-08T11:33:19.983

Reputation: 793

0

If you want to restore your MBR back to its original state and you have win 7 or vista you can do this:

  1. Put the Windows Vista or Windows 7 installation disc in the disc drive, and then start the computer.
  2. Press a key when you are prompted.
  3. Select a language, a time, a currency, a keyboard or an input method, and then click Next.
  4. Click Repair your computer.
  5. Click the operating system that you want to repair, and then click Next.
  6. In the System Recovery Options dialog box, click Command Prompt.
  7. Type Bootrec.exe /FixMbr, and then press ENTER.

Blomkvist

Posted 2011-05-08T11:33:19.983

Reputation: 2 379