Monday, April 13, 2009

The elusive MBR

Welcome back to Disk Tech! I get many, many questions about the Master Boot Record (MBR), so I thought I would spend a few minutes detailing the history, purpose, and layout of this elusive section of a hard disk. This isn't the most exciting topic, so try to bear through the technical details while looking for the parts you may find interesting.

In a nutshell, the MBR is nothing more than the data stored in the first sector (512 bytes) of your hard disk. While small, these 512 bytes contain enough information to define the size and location of the partitions, store the disk signature, and hand over the boot process to the operating system. This sure seems like a lot of information for such a small space, let's break it down.

It is difficult to identify one section of the MBR as more important than others, but my personal favorite is the partition table. As you may know, a disk partition is simply a logical division of the disk into smaller chunks, frequently used to separate operating systems and/or data. The partition table simply identifies the location and size of each partition, as well as additional information such as the type of filesystem and whether the partition is bootable. While a single partition may provide access to the entire disk, and is sufficient for normal operation, many folks prefer to create multiple, smaller partitions in order to test various operating systems such as Linux or new versions of Microsoft Windows. This methodology enables each partition to operate independently of each other, preventing corruption in one partition from extending to others. The MBR standard allows for a maximum of four primary partitions.

Each MBR requires the last two bytes of the sector to contain AA55, which officially determines a valid MBR. While seemingly insignificant, the MBR will be considered corrupt, or even nonexistent without this indicator. You will frequently find these two bytes referred to as the Magic Number.

The disk signature is simply a unique identifier for the disk, and was added to the MBR a few years ago by Microsoft. It was originally introduced so Windows could remember information about the disk between reboots, but is also frequently used by other operating systems as well. Each time a new partition is recognized by Windows, it records the partition location and disk signature in the registry, along with the assigned drive letter. The next time Windows is booted, it makes certain that both the disk signature and partition details match, enabling the correct drive letter to be reassigned. The disk signature is located at byte 440 in the MBR.

Last but not least we are left with the first 446 bytes of the MBR, commonly referred to as the boot loader section. The boot loader is actually a small computer program, and consists of instructions that tell the computer what to do as it starts. Once the boot process turns control over to the boot loader, the partition table is scanned in order to identify the active (bootable) partition, and control is turned over to the correct partition boot record in order to start the operating system.

Although small, the MBR may be the most important sector on the entire disk. If the MBR becomes damaged or destroyed all partition information will be lost, meaning... all files/folder/data on the disk will be inaccessible (gone!) In order to prevent data loss, please, please, please make sure you take a few minutes to backup the MBR. There are several utilities available to backup/restore/repair the MBR, but I find MBRWizard the easiest to use. Check out http://mbrwizard.com.

Like I mentioned at the beginning, this isn't the most exciting topic, but it does provide a good overview of the purpose and structure of the MBR. Hopefully you have learned something new, and feel impelled to backup your MBR right now, before anything terrible happens to it!

Friday, March 20, 2009

WTF is MTBF? (or, when is my hard disk going to crash)

How long do you expect your hard drives to last? How long are they made to last? How long does the average HDD actually last? These are normal questions that inquiring minds want to know, so let's hit the streets.

Unfortunately there is no quick and easy answer to disk longevity. Looking up some of the manufacturers specifications, you can find number such as 500,000 hours MTBF, or Mean Time Between Failure. This number represents the mean operating lifetime of a disk. But wait, 500,000 hours is long time... approximately 57 years! Good luck finding a manufacturer that will warranty their disk any longer than 1/10th of that time.

As with most numbers, there are many variables that play into the longevity a disk. For example, most manufacturers assume an average of 2400 POH (Power on Hours) per year, meaning they expect that your computer will be turned on less than 8 hours per day. Furthermore, heat is a real killer with most electronic components, but especially hard disks. Increasing the temperature of a disk from 45 F to 125 F drastically reduces the MTBF, sometimes as much as 90%. But even in the worst case scenario, operating a 500,000 MTBF hard disk 24x7 at high temps should still give you 5+ years of service.

But wait, there's more. Duty cycles play a big role in disk longevity as well. A hard disk sitting in an XBox console may only get light, intermittent use, while a disk handling video conversions will take a pounding. With that in mind, the harder a disk works, the higher the operating temp, resulting in a shorter lifetime.

And none of this takes into account manufacturing problems. There can be hardware problems which cause a disk to fail, but fortunately most hardware related disk problems show up within the first year. The manufacturer understand this, and provides the warranty just in case this happens, but it also provides them with confidence to provide a longer warranty. In other words, if the disk makes it through a year, it should survive another 4 or 5.

So, how long will your disk last? Like I said in an earlier post, I have disks that have failed within an hour of installing them, but I have an old Seagate disk that has been running reliably for the past 10 years. I tend to lean towards Seagate disks simply because they provide a solid 5 year warranty, rather than kicking myself when the 3 year warranty disk fails after 3 years and 2 months. Longer is definitely better.

Unfortunately there is no way to tell when a disk is going to fail. If you start hearing a clunk, or whine, or other warning signal... well, it's probably too late. In this situation I typically shut it down, boot to my favorite disk imaging CD, and pray that I can create a full backup of the disk before it fails completely. But of course, in worst case scenarios you can always revert to the backup captured the night before, right???

Disks will fail. If there is anything you should know about computers, it's that disks will fail. Some will fail faster than others, maybe because you stuck it in hot, unventilated computer, or abused it other ways, but know that it will eventually fail. Please, please, please don't learn the hard way like most people. A disk may be rated for 50 unrealistic years of use, but don't bank on it. Make sure you have a plan, and back everything up regularly!

Tuesday, March 17, 2009

Backup is for fools!

Who needs backup? Who really cares if everything they have been working on for years crashes, burns, and is gone forever? Who needs those pictures, home videos, tax forms, and bank statements? Wouldn't it be nice to wipe the slate clean and simply start over?

As lame as that may sound, this is what most people seem to think... or at least this is how most people act. Scary.

All disks will fail. Expect it. I have disks that have gone south in as little as a couple of months (thank goodness for warranties.) On the other hand, I have a disk in a small network device that has been running nonstop in my basement for 10 years now. Just know that all disks will fail... but we never know when.

From my experience, it seems that most people don't take backup seriously, that is until they lose something of value. Pick a backup scheme, any backup scheme. I don't care which backup methodology you choose, just pick one and run with it!

On that note, there are a ton of backup strategies out there! I have my favorites, and they work well for me, let's see if you can tell from the following methods which one I choose:
  • Disk Image Backup: This provides a complete backup of your entire disk, including data, operating system, configuration, etc. In case of total disk failure you can simply restore the image to a new disk and voila, you are back up and running! Quick and Easy! My favorite product for this method is StorageCraft ShadowProtect, but Symantec and Acronis also offer similar products.
  • File Level Backup: Provides quick backup of specific files and folders on the disk (think pictures, tax forms, etc.) While generally faster to backup, and results in smaller backup files, a total disk failure will force you to find that Windows/Mac/Linux cd, and start the install from scratch. A fresh install isn't necessarily a bad thing, and generally speeds up your system like it's new, but this isn't the best of use time when you just want to get your system back up and running. There are literally tens to hundreds of products on the market that can help you keep individual data files backed up.
  • Mirror/Replication: Mirroring and replication are completely different animals, but they both provide the same functionality... making sure everything is saved in two places. This means that every time you save a file, that file will also be written to a second disk or system, which is always ready to take command if needed. While replication is utilized most often in large business, mirroring is found everywhere. The main downside to this strategy is that if you delete or corrupt something on your disk, that change will be replicated... Uggg!
There are other strategies you may want to consider, as well as recovery methods, and places to store all that data, but I will discuss those at a later time. Like I said earlier, I don't care which backup method you choose, just make sure you get everything backed up. Remember, there are only three sure things in this world... Death, Taxes, and Disk Failure, and you want to be prepared for all of them!