Recreate MBR without losing data

Juddog

Diamond Member
Dec 11, 2006
7,851
6
81
Situation: MBR gets wiped out from boot loader program. Is there a way to recreate this without wiping out all of my data?
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
short answer, yes. Let us know what OS's. Assuming a Windows Simple volume..

Your sector 0 basically looks like:

MBR code
leftover space for larger MBRs
4 line partition table.
End of sector marker.

There is no actual data in sector 0. Anything there can be reconstructed. MBR can be loaded (for windows) by running FIXMBR.

Note that fixmbr writes that blank space between mbr and parition table by writing blanks until it gets some calculated distance away from the end of sector marker. If the marker is missing it will zero the partition table.

Partition table can always be reconstructed by hand with diskprobe (some utility automates it I'm sure) simply by finding the start & stop sectors of your partitions. These are found by searching for the partion boot sectors as well as the end of partition backup of the same.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Partition table can always be reconstructed by hand with diskprobe (some utility automates it I'm sure) simply by finding the start & stop sectors of your partitions. These are found by searching for the partion boot sectors as well as the end of partition backup of the same.

Sadly, anything that scans your disk looking for partitions by looking for filesystem signatures will quickly get confused if you have any VM disk images on there too.
 

Tennoh

Member
Jan 30, 2000
116
0
76
Sadly, anything that scans your disk looking for partitions by looking for filesystem signatures will quickly get confused if you have any VM disk images on there too.

How so? Assuming its just the MBR that's fubar, then your boot sector, usually at sector 63, should contain valid hex geometry of the partition. With that you can confirm the end sector by sector mapping. Once that's done you can input the valid geometry back into your MBR and voila, viewable partitions. Done it tons of times while in Microsoft ESS team.

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
How so? Assuming its just the MBR that's fubar, then your boot sector, usually at sector 63, should contain valid hex geometry of the partition. With that you can confirm the end sector by sector mapping. Once that's done you can input the valid geometry back into your MBR and voila, viewable partitions. Done it tons of times while in Microsoft ESS team.

Because I was talking about automated software like gpart.
 

C1

Platinum Member
Feb 21, 2008
2,340
90
91
Essential disk maintenance tools have moved to the Recovery Console,
which is available when you boot from the original XP CD. You cannot
actually change the MBR while XP is running.

Here's the Microsoft support article which describes how to access the
Recovery Console:

http://support.microsoft.com/?kbid=314058

Once you're in the RC, use the command FIXMBR, which is the equivalent
of fdisk /mbr (it writes a fresh copy of the MBR).
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Originally posted by: Nothinman
How so? Assuming its just the MBR that's fubar, then your boot sector, usually at sector 63, should contain valid hex geometry of the partition. With that you can confirm the end sector by sector mapping. Once that's done you can input the valid geometry back into your MBR and voila, viewable partitions. Done it tons of times while in Microsoft ESS team.

Because I was talking about automated software like gpart.

There is some stuff out there that can automate it. Who's that big data recovery place? ..been to long., they had some utilities CD that did some of this. I haven't actually done digging but I would be surprised to hear that nobody has written a good one.

VM disk images shouldn't freak it out too bad. The boot sector wouldn't necessarily be on a sector boundary if inside a file and you would have a lacking or mismatching backup boot sector at the end of the partition plus a missing boot back to back boot sector marking the start of the next. You might also end up with over 4 partitions without an EBR which would trigger software to question the sector scan result.

Your best bet is always diskprobe and some kung-fu though.



edit: Ontrack is the name of that company.
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Originally posted by: C1
You cannot actually change the MBR while XP is running.

If Microsoft said this, and I'm not saying they didn't, it would be a bit of a white lie.

It's kindof like "you can't change a dynamic disk back to basic"...it takes changing one byte in the partition table often times. It's those other more complicated times that makes it best to tell folks it can't be done.

 

Juddog

Diamond Member
Dec 11, 2006
7,851
6
81
Originally posted by: C1
Essential disk maintenance tools have moved to the Recovery Console,
which is available when you boot from the original XP CD. You cannot
actually change the MBR while XP is running.

Here's the Microsoft support article which describes how to access the
Recovery Console:

http://support.microsoft.com/?kbid=314058

Once you're in the RC, use the command FIXMBR, which is the equivalent
of fdisk /mbr (it writes a fresh copy of the MBR).

I had heard rumors that running this would cause damage to the data on the drive itself. Will running the fdisk /mbr from the command console affect the data in any way other than the MBR?
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
No, this is all sector 0 stuff. Partition boot sectors, MFTs and data are unrelated.

The worst that could happen is if the end of sector marker was damaged. It would cause the partition table to get wiped. This can be recovered either with some utilities out there or if push comes to shove I'd help you do it with diskprobe*



*would require you to mount the drive in a working box, install diskprobe, and then we'd setup a livemeeting (remote desktop) session.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |