Recovering Windows Boot [Linux]

When setting up a friends PC with Linux the other day, I decided to begin by partitioning the hard drive with the Gparted Live CD. I learned that Gparted is a great tool to create partitions but it also tweaked my Windows install making it unable to boot. I’ve also heard of this happening on the occasional install of Ubuntu and other distro’s where the MBR will be written incorrectly. Fortunately though I did the research and was able to fix it. Here’s what I did:

Anyone that has been around Linux long enough has seen this problem before. There are two types of errors that can cause Windows not to boot properly. First there is a damaged MBR. The MBR (Master Boot Record) is a 512-byte sector at the beginning of the disk that holds the partition table and the information for bootstrapping an Operating System. And second possibility is the partition boot sector (NTFS, FAT…) becoming corrupted. The partition boot sector is part of a metadata file that begins at the initial 512 bytes of the partition and followed by several others sectors which are called by the boot sector’s IPL (intial program loader). If either one of these are broken, Windows will not boot.

Now, if Windows is reinstalled or there is a misconfiguration with Grub, Grub will need to be correctly setup and installed back into the MBR as the bootloader. Catlett writes a good guide about this.

If say the Linux partition is deleted, Windows will fail to boot because the program (Grub) and it’s configuration file are stored there. If this is the case, Windows needs to be put back in charge of the MBR. Meierfra, at the Ubuntu forums explains how to do that. You’ll need the Windows Install Disk to do this, or sometimes the recovery disks will do. If the computer didn’t come with Install Disks or Recovery disks (as they do sometimes nowadays) then TestDisk might be an option. Read below.

However if Grub and MBR are set up correctly, then the partition boot sector needs to be repaired (this is what happened to me). This can be done in two ways I know of with TestDisk or ms-sys.

TeskDisk Success

Warning: I’m not an expert in using this program, so keep in mind that setting the wrong options could make the problem worse, but this did work for me.

TestDisk has the capability to rebuild the NTFS boot sector and recover a FAT one. Start TestDisk and select the disk then partition table type. In the “Advanced” option select the partition Windows boots from then select the “Boot” option. TestDisk showed the Boot sector as OK and the Backup boot sector as bad, funny I thought that it would be oppposite. I had no choice though (besides a clean install of Vista [I hadn’t heard of ms-sys at the time]) and choose to rebuild it anyhow. I rebooted the computer and got my Vista back.

Fix Boot with ms-sys (Untested)

An alternate method of fixing the MBR is using the ms-sys program. I have yet to try this but alot of feedback at this post makes it seem to work pretty well. I’d like to hear feedback.

How to fix your Windows MBR with an Ubuntu liveCD

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

Posted on 2008-11-06, in Linux. Bookmark the permalink. 2 Comments.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: