Friday, January 9, 2009

NTFS drive corrupted due to power failure!!!

I was working on my PC, when power went off. 3+ year old UPS gives a second to shutdown and even Mr. Bill Gates or Steve Balmer or whoever can't shutdown any Microsoft OS(except DOS) within 10 seconds!!! By the way, after power was back, I turned on my PC and damn!!! To my utter dismay, the Windows XP loading progress bar revolved twice and the PC restarted!!! I tried "Last known good configuration" and same happened with it as well. Finally I thought about safe mode and tried that too to find that it too hasn't any future.
They claim NTFS doesn't die on power failure? But what went wrong here???? I use NTFS especially for this feature but Microsoft cheated!
I had(have) lots of important data and I didn't want to loose anything. I slipped in the XP CD in the optical drive and went straight to Windows installation in order to repair, and there found that my Windows drive C was being recognised as Unknown Partition! Luckily other partitions were healthy.
I thought I should try Linux. I restarted the PC to find out that XP installation CD had wiped out GRUB!!! Well... That doesn't sound tough. I restored GRUB using the Good old Live CD trick. How? Just boot through Ubuntu live CD. Open terminal by pressing Alt+F2 and typing xterm. In the terminal type:
sudo grub
find /boot/grub/stage1

It'll give output similar to (hd1,1)
Then type:
root (hd1,1)
setup (hd0)

I've two hard disks. Linux calls them hd0 and hd1. Ubuntu is on hd1 and Windows on hd0. The above piece of code set up GRUB on Windows drive i.e. first hard disk i.e. hd0.
Then I booted into Ubuntu and tried to mount the Windows drive. It gave a long error message asserting to try "chkdsk /f". What to do now???? I found out the FreeDOS CD from my 500CD stack and slipped it inside and booted. And striking me again, it didn't detect NTFS drives!!!!! It supports only FAT.
Finally, the idea of using Recovery Console flashed in my mind. So, I booted through Windows XP installation CD and pressed R when prompted, to enter Recovery Console. It brought me to the C:\ prompt. I changed to D, E, F and found that all data on them was intact. Only C was refusing to enumerate the directory listing.
I typed
chkdsk /f

and it said /f switch isn't supported!
then I tried
chkdsk /r

and viola, it worked!!! It took 15 minutes and repaired the corrupt NTFS partition C:
And after a restart, I got back to my familiar desktop with all data intact!

1. Don't panick and format and reinstall Windows if you can't boot. Try alternate ways if you care for your data.
2.Spend some bucks and get a good UPS!!!

No comments: