Repairing unbootable Windows XP systems with one command

by Rudd-O published 2006/05/24 01:10:00 GMT+0, last modified 2013-06-26T03:24:20+00:00

Perhaps you've read the fabulous Repairing Windows XP in Eight Commands - Guide - Short-Media already. Perhaps not. But what happens when you can't even get to the recovery console?

Yes, it does happen. Sometimes the file system of your boot volume gets corrupted... oh, okay, that probably sounded like gibberish, but it's true. In other words, your disk can get so messed up, that you can't even get to the recovery console because Windows XP will boot, show the Windows XP logo, wait a few seconds, and then simply restart.

How on Earth do you fix this?

Easy! You just use Linux to solve this problem. Now, pay attention, because this solution does require some elbow grease, but if you need your files right away, you'd better be prepared.

First step: download INSERT

INSERT is the Inside Security Linux distribution. It comes with a lot of utilities designed to perform forensics and fixing systems (yes, even Windows XP!). Additionally, you have full read and write capabilities for Windows XP's NTFS file system (which isn't included in most Linux distributions. As if it weren't enough, INSERT is a very small download (in relation to other Linux distributions). And, finally, it will autodetect your computer's hardware, without the need for installation.

So, just in case, download INSERT and burn it on a disk. It fits on a business card-sized CD-R (normal CD-Rs are also okay). Place it in your wallet, or on your car's glove compartment -- you'll end up needing it eventually.

Step two: boot into INSERT

Insert your newly burnt INSERT disk on your computer, and tell your computer to boot from the CD-ROM (instructions for this, of course, vary, since this is a task to be done through the BIOS or the boot menu of your computer).

Here's how your BIOS boot menu may look like.  Take it with a grain of salt.
Here's how your BIOS boot menu may look like. Take it with a grain of salt.

After INSERT boots, you'll see a prompt with a nice logo.

Here's the boot menu that shows when booting from the INSERT CD

Type insert 2 and hit ENTER. You'll see INSERT booting and autodetecting your hardware, and then you'll be dumped into a command interpreter. That's Linux.

Here's how INSERT looks like when it's inspecting your computer
Here's how INSERT looks like when it's inspecting your computer

And here's the INSERT prompt.  This is a bash shell.
And here's the INSERT prompt. This is a bash shell.

Do not be afraid. Everything is just fine.

Step three: fix your NTFS volume

If you're like me, and you have an El Cheapo computer (which is, like, 99% of the world population) you'll have a single IDE disk. If you're not so lucky (or, perhaps, even luckier, and you have several disks) you'll have SATA or SCSI disks, one or more. View the contents of the /etc/fstab file:

cat /etc/fstab

should show you the contents of that file. You'll see several lines, and each line will most probably begin with a /dev/hdXX or /dev/sdXX. Usually, your first NTFS volume should be /dev/hda1 (for IDE disks) or /dev/sda1 (for SATA or SCSI disks).

The contents of my hypothetical /etc/fstab file
The contents of my hypothetical /etc/fstab file

Run ntfsfix on it.

ntfsfix /dev/sda1

That should chug along for a few seconds, perform some checks, and return to the prompt. Voilà! Your Windows XP system should be bootable again. Type sync then hit ENTER to ensure data to the disks is written, wait for two seconds, and then hit the reset button of your computer (or power it off and then back on). Don't forget to remove the CD-ROM as soon as the computer starts.

Once Windows XP boots, you'll see it claiming that it needs to check the disks. Let it check your disks.

That's it. Your computer should now boot normally

Going beyond

Of course, while using INSERT, there's a lot of things just waiting to be discovered. You'll be able to back up your data onto other disks without touching anything from the source disks. You'll also be able to log on to the Internet and download software. You'll also be able to check your disks for Windows viruses. But that's material for another article. In the meantime, I hope this small tutorial has convinced you to give Linux a shot. Perhaps you won't need to rescue a Windows XP system ever again ;-)

Hope everything's working just fine for you now. Have a great day!