Fix MBR in Windows XP and Vista By Yourself

What is the MBR?

fix mbr A master boot record (MBR), or partition sector, is the 512-byte boot sector that is the first sector (“LBA Sector 0”) of a partitioned data storage device such as a hard disk. (The boot sector of a non-partitioned device is a Volume Boot Record. These are usually different, although it is possible to create a record that acts as both; it is called a multi boot record.) The MBR may be used for one or more of the following:

  • Holding a disk’s primary partition table
  • Bootstrapping operating systems, after the computer’s BIOS passes execution to machine code instructions contained within the MBR
  • Uniquely identifying individual disk media, with a 32-bit disk signature; even though it may never be used by the machine the disk is running on

If, for any reason, the MBR becomes damaged or corrupt, then the operating system will be unable to load. You will normally see error messages like:

  • Error loading operating system
  • Missing operating system
  • Invalid partition table

These messages are definitely not fun, especially if you are not familiar with computers. Most people would automatically assume their computers are dead! However, that’s not true. Being in IT myself, these errors are actually preferably to other types of Windows errors. Why?

Well, it’s actually fairly easy to fix the Master Boot Record in XP and Vista. All you have to do is load up the Recovery Console and run a simple command. All of your data, applications, settings, etc are still intact on the drive and once the MBR is fixed, the computer will load normally.

So how can you repair your damaged MBR?


Here are the steps to follow:

1. First, restart your computer with the Windows XP setup disk in the CD drive. If you don’t have your original disk, borrow one or download a ISO image from a torrent site.

2. When prompted, boot from the CD drive by pressing any key. If Windows loads automatically, you will first have to enter the BIOS setup and change the order of the boot devices to start with the CD drive.

fix mbr

3. Once the setup loads, you will see the option to press R to repair a Windows installation.

fix mbr 02

4. Once the Recovery Console loads up, you will have to type in a number that corresponds to your Windows installation. This is normally just 1. Press Enter and then type in the Administrator password.

fix mbr 03

5. Now at the prompt, type in fixmbr. Your damaged MBR will now be replaced with a new master boot record and your computer should now be able to boot properly. Note that you may also want to run the fixboot command to repair the boot sector with a new one.

Also, make sure you only use these commands on a system with one operating system installed. If you have more than one operating system installed, fixmbr and fixboot could mess up everything.

Fix MBR in Vista

In Vista, the procedure to fix the master boot record is a bit different. You have to start up Vista in the Recovery Environment and then run the bootrec command. Here’s how.

1. First, load up the Windows Vista disc in your drive and press any key to boot from the disc.

2. Choose the language, time, currency, etc and click Next. Now click on Repair Your Computer.

fix mbr 04

3. Choose the operating system to repair and click Next. When the System Recovery Options dialog comes up, choose the Command Prompt.

fix mbr 05

4. Now type bootrec.exe and press Enter. This will rebuild the boot configuration data and hopefully fix your problem. You can also run the command with switches to fix just the master boot record (/fixmbr), the boot sector (/fixboot), or rebuild the entire BCD (/rebuildbcd).

Fix MBR on Windows 7

1. Insert Win 7 installation DVD and boot from DVD drive. While in some older systems you may have to change boot order through system BIOS, most newer systems allow booting from DVD without changing boot order by simply clicking on any key when prompted to doing so.

2. Choose your default “Language”, “Time”, and “keyboard Input” on the first window and click next.

3. You’re now presented with 3 choices. Click on “Repair Your Computer” to gain access to the System Recovery window. Now choose “Command Prompt” in order to run the desired utility which is called “bootsect.exe”. Bootsect is located inside the boot folder so change your directory to boot. Now run “bootsect /nt60 C:\” if you had Win 7 initially installed in the C partition. Alternatively, you can run “bootsect /nt60 SYS” or “bootsect /nt60 ALL” to repair the system partition or all partitions. Eject the DVD, and restart computer. Your computer should now boot Win 7 again.

Read More

What is ATA/IDE?

ATA IDE Hard DriveWhat is ATA/IDE?
Integrated Drive Electronics
(IDE) is a generic term applied to any drive with an integrated (built-in) disk controller. The first drives with integrated controller were Hardcards. In the IDE architecture, the disk controller is integrated into the drive. This combination drive/controller assembly usually plugs into an interface on the motherboard or an interface card plugged into an empty bus slot. The ATA Specification is simply a set of rules or guidelines that an IDE drive should conform to.

Data transfer modes
PIO-Modes

PIO stands for Programmed Input/Output and was the standard way of using ATA devices but it has become less popular, in favor of the new DMA modes. There are five different PIO modes, each have different transfer rates. The higher the mode number the higher the transfer rate. All PIO modes use the CPU to transfer data which makes this method unsuitable for multitasking environments. Which brings us to the transfer mode used today: DMA.

DMA modes

DMA stands for Direct Memory Access and is the term used when a peripheral device transfers data directly to or from memory, without the use of the CPU. Today DMA is the only feasible way to transfer data from the hard drive to memory as most of todays operating systems use multitasking and can better use the CPU for other tasks. The first DMA modes were not adopted by the popular OS’s of the time, but when Ultra DMA mode entered the scene it quickly became commonplace. The main difference between Ultra DMA and the older singleword and multiword transfers was that Ultra DMA mode clocks the data twice per clock cycle thereby doubling the bandwidth. The most favored today is Ultra DMA mode 2, aka UltraDMA/33.

Standards
ATA-1

To eliminate some major compatibility problems with the early ATA/IDE drives the ATA-1 specification was defined as an ANSI standard in 1994. Previously the most common problem showed up when drives of different manufacturers were placed as master and slave on the same channel.
The original ATA/IDE standard defines the following features and transfer modes:
It supports one or two harddrives on the same bus. One is configured as master and the other as slave.

ATA-2

The ATA-1 standard defined what the interface was capable of a decade ago, and there was a need for faster transfer rates and enhanced features. In 1996 the ATA-2 standard was defined as an ANSI standard that is backward compatible with the older ATA-1.
– Faster PIO modes: 3 and 4.
– Faster DMA modes: 1 and 2
– “Identify Drive” command allows software to query the drive for it’s geometry and characteristics (Plug ‘n’ Play).
Several manufacturers marketed drives based on ATA-2 under different names like “Fast-ATA”, “Fast-ATA-2” and “Enhanced IDE”, which are all marketing terms and not real standards.

ATA-3

In 1997 this ANSI standard was defined and can be viewed as a minor revision to ATA-2 and includes improves the reliability of the faster transfer modes introduced with ATA-2. Also added was the open standard for monitoring disk drive health, SMART

ATA/ATAPI-4

This revision adds some significant and long-awaited features:
– ATAPI (AT Attachment Packet Interface) for devices that require commands not available in the standard ATA standard like CD-ROMs and CD-R.
– Removable Media (Zip drive).
– Overlapped feature set allows devices that require extended time to perform a bus release so that other devices on the bus may be used.
– Ultra DMA data transfer protocol, aka Ultra ATA, which clocks data twice per clock cycle by using both the negative and positive transition.
– Defines an 80 conductor cable to be used for Ultra ATA devices, it is not mandatory however.

ATA/ATAPI-5

Adds Ultra DMA mode 4 or Ultra DMA/66, the 80 conductor cable is now mandatory to maintain signal integrity.

ATA/ATAPI-6

Not finalized yet. It will definately add Ultra DMA mode 5 or Ultra DMA/100 as it is already integrated in drives manufacturered today. Discussions are being held concerning noise reduction which can be found in drives shipping today as well.

Cabling for ATA

It’s easy to describe the different cable types used by the ATA interface today because there really is only one standard. And that is a 40/80 PIN flat cable with 3 IDC connectors. You can attach up to two units on the cable, one master and one slave. The 80 pin cable is for use with Ultra DMA devices but the 40 pin cable can be used with newer Ultra DMA devices but no faster modes than Ultra DMA/33 are available in that case.
In latter years a new cable has emerged, a 44 pin flat cable which is mostly used for 2.5″ internal harddrives. The 4 extra pins are used for supplying power to the drive.

Future for ATA

In order for the ATA interface to cope with the increased data clock rate in the future, a proper terminator has to be applied to prevent “ringing” in the cable. This is not easily solved while achieving backward compatibility and will require cooperation between the major hardware manufacturers to make it work. Perhaps a solution is around the corner as there is a draft for a FireWire ATA interface.

Read More

Can a Regular Person Repair a Damaged Hard Drive?

This story was written to detail the options a user has when a hard drive with important data dies unexpectedly. Many of you have left comments advocating the freezer trick, stating that used as a Hail Mary, you’ve had good results. I do not dispute that the freezer trick *can* work. If you have a hard drive you don’t really care about, and you’re curious to see if you can get the data, by all means, freeze it.

If you do need your data back to the point that you’re considering paying someone to retrieve it, do not freeze the drive, even as a Hail Mary. You may very well make the problem worse and end up costing yourself money.

On June 22, 2012, my primary hard drive, a Samsung HD103SI, quietly passed away. There was no warning — no grinding, no clicks, clacks, or sudden bang. One moment, I was working on a story, the next, I wasn’t.

It quickly became clear that something more serious than a simple system lock had happened. Post-reboot, the HDD would spin up smoothly, beep 12 times, and then spin down. The drive was never recognized in BIOS, which nixed any chance of using disk recovery software to extract data.

This is a story of my efforts to repair the drive myself, my research into the question of whether or not users can repair modern hard drives, and the results of my efforts. If your drive is still detected in BIOS, you may be able to use software tools to retrieve your data. Here, we’re going to focus exclusively on hardware-related failures, and what your options are.

Part of the reason for writing this story is that data recovery is difficult to accurately research unless you’re fairly versed in it to start with. There are dozens of data recovery firms, all promising clean rooms, the latest tools, and highly trained professional staff. Many firms refuse to publish their prices online, which makes comparisons difficult, and it’s apparently common for small companies to farm tough jobs out to larger ones.

Step 1: Broadly identify the type of problem

There are two broad categories of problems that can nuke a drive: PCB issues and internal component failures. If the problem is inside the drive, skip down to Step 3. If the problem is on the PCB, there is a glimmer of hope.

damaged-hard-drive-pcb

The best kind of PCB problem to have is a blown Transient Voltage Supressor (TVS) diode, as shown above. According to Seagate’s FAQ, a TVS diode “protects a sensitive circuit by diverting damaging overvoltages and spikes away from the load.” When a spike occurs, the diode blows. Because the diode is no longer functional, the drive won’t power up. Snip the diode off, and the drive will function normally, albeit in an unprotected fashion. Copy your data over to a functional unit, toss the old one, and count yourself lucky.

My hard drive unfortunately didn’t die this way. There was no visible damage to the PCB but when I removed the board and flipped it over I found a burned-out contact point.

Step 2: Understand your options

From here, you’ve got two choices. You can opt for a replacement PCB, or you can buy an entire donor drive. It’s important to secure as close a match as possible between the original HDD and the donor drive/board. In my case, that meant finding an HD103SI PCB that matched my drive’s make/model number, PCB number, board revision, and drive family (Trinity, in this case).

hdd-pcb

The drive controller model number and PCB codes are outlined in red.

hard-drive-pcb

Understand this: Simply replacing the PCB almost certainly won’t fix a dead drive. If it does, you’ve gotten lucky. Each drive ROM contains parameters and data unique to that particular device — if the parameters for your dead drive are different from those contained on the donor PCB, it won’t function.

In my case, I opted for just a PCB. In retrospect, a full drive might have been the better option, but the purchase only set me back $22 and ~14 days while my part took the slowboat from China. Swapping out the PCB eliminated the 12 beeps, but accomplished nothing else. Beep-less, my drive sat mute — spinning, but unrecognized in BIOS.

Your options at this point depend on what sort of HDD you have. Some hard drives have an externally mounted ROM/NVRAM chip that can be removed and soldered on to a new PCB. Other drives, like mine, incorporate the ROM into the controller. The only way to find out is to go digging for information online, and you’ve got to apply a strong sort filter to estimate the value of what you’ll find. A number of dubious websites advertise a “PC3000 PCI” card, for example, but this is almost always a Chinese clone of the original product, and is far too old to handle modern drives in any case. The real PC3000 UDMA test kit runs over $4000 — far more than the typical cost of a data recovery.

After my simple PCB swap didn’t work, I decided to try to repair the burned contacts on the original board. Here, your options are to either buy a conductive ink pen or to use something a bit more humble. I took the humble option, trotted over to an auto parts store, and picked up a rear window defroster repair kit. I taped off the damaged contact, applied the conductive ink, gave it 12 hours of drying time, fired up the drive…

hdd-pcb-3

My repaired PCB. The burned contact is at the far lower right of the group

And nothing had changed. The drive still spun up, emitted twelve beeps, and spun back down.

That was my second major disappointment and it leads directly to the next step…

Step 3: Resist the urge to do something stupid

Surf the internet for more than two minutes, and you’ll find people who recommend you do one of the following things:

  • Stick your hard drive in the freezer
  • Pop your hard drive into the oven
  • Give it a few taps with a hammer or rubber mallet

People will swear by these options and promise you that they’ve revived 15 drives just this way. Don’t listen. I’m not claiming that no person ever brought a disk back to life by jamming in amongst the frozen peas, but this strategy is far more likely to cause irreparable damage than it is to miraculously affect repairs. Keeping the drive in a ziplock bag while in the freezer won’t help; condensation will form on the drive when you remove it from the bag prior to firing it up again.

drive-freezer

This is what happens when you take a drive out of a freezer — whether you bagged it or not

Leaving the drive in the bag until it’s returned to ambient air temperature might prevent condensation from forming on the platters or heads, but the point of the freezer trick is to run the drive at a lower temperature.

Every repair attempt you make should be balanced against the chance of doing additional damage. To that end, never open the enclosure. If putting your hard drive in the freezer is a bad idea, opening it is infinitely worse. You are not qualified to adjust the alignment of heads or platters that normally spin at 75 mph and are aligned to tolerances measured in micrometers.

Step 4: Hire a professional

This is where I ended up. I talked to a number of data retrieval companies, including Datacent and Secure Data Recovery Services. Datacent quoted me a $750 rate for drive head replacement; Secure Data Recovery was less certain of the cause, but believed repair would likely run between $1,200-$1,500. As of this writing, I haven’t decided what to do. Even after extensive research, my objective visibility on Datacent (or any other data recovery firm) is just about nil. If I opt for repair, I’ll certainly report back on my experience, but ultimately I have no way of knowing how difficult it will be for a properly equipped facility to recover my files, how long it will take, or what constitutes a fair market rate.

With all of that said, here’s a few tips on what to look for (and what to avoid).

  • No data, no fee: Avoid companies that insist on charging you for the privilege of failing to provide a useful service.
  • Low-cost evaluation + return fee: Many firms offer a free diagnosis but will charge relatively high postage to send the drive back. $25-$30 for an evaluation+postage seems fairly reasonable, we’d be cautious of companies charging $50 or more for the two services combined.
  • Avoid broad estimates: No firm can completely diagnose a hard drive by remote, but that doesn’t mean they can’t get an idea for what’s wrong. Beware of companies that offer estimates broad enough to buy a car with. At the very least, ask for estimates that fit the typical cost of specific problems
  • Check the price of parts: The quotes we received typically included the cost of replacement parts. Most companies also note, however, that difficult-to-find hardware may still add additional cost. It doesn’t hurt to see if you can self-source the part, particularly when the cost of a donor drive or PCB is a very small fraction of the total recovery fee.

Step 5: Get a (better) backup solution

I’ve learned two important lessons from this failure. The first is that different models of hard drive are more and less user-friendly; careful selection on my part when I bought the drive four years ago would’ve made it much easier to recover my data. The second is that a better backup strategy would’ve made the first point moot. Because I had a basic, episodic backup solution, much of my older data is safe. The only data I lost… was all the data related to ongoing projects that hadn’t been published yet.

That stung. The difficulty of recovering my information in the intervening month only made the situation that much more frustrating.

If you don’t have a backup solution and you actually care about your data, get one. There’s no guaranteed solution once the drive has failed and, unless you get lucky with a TVS burnout, no easy fixes. A burned out drive is your ticket to a whole lot of website surfing, information sifting, and one enormous headache from trying to separate “My cousin’s uncle’s friend’s neighbor’s dog knew a dude who threw his hard drive in a pool and it worked great” from real, reliable, data.

The forums and information at HDDGuru are a good place to start checking for information, but don’t be surprised if you have to check other places just to get an idea of what the problem might be. These waters are largely uncharted, and dragons lurk in the deep.

PS. Don’t do the freezer thing. Really.

Article By Joel Hruska.

Read More