How many of you have had that sinking feeling as your PC boots up? You know, a slight niggle in the back of your mind that says “this is taking longer than usual” before Windows drops dead in front of you, and refuses to play ball.

There are a few good reasons to have Ubuntu on a CD or USB stick somewhere in a draw. It’s free, to start with. You don’t need to install it to use it, and it’s great for accessing a butchered Windows partition – even if it’s just to get your precious documents back before a format.

If you’ve done everything correctly you’ll see the UNetbootin bootloader appear. From here you’ll want to boot directly into the operating system. After a minute or two you’ll see the desktop appear, and we’re ready to begin.

Fixing A Corrupted Windows NTFS Partition

Luckily you can schedule an NTFS consistency check within Ubuntu to attempt to repair your tattered Windows partition, but you’re going to need to install a couple of things. It is worth mentioning that this should work with any NTFS drive that refuses to mount in Ubuntu too. Open a Terminal window by clicking Applications, Accessories and then Terminal.

First install NTFS-3G by typing this command:

sudo apt-get install ntfs-3g

Enter your password and hit Enter on your keyboard. Next install NTFSProgs in the same way:

sudo apt-get install ntfsprogs

Now with both of those tools at your disposal, you can set about fixing Windows. First locate your Windows partition. In the Terminal type:

sudo fdisk -l

You’re looking for an entry that looks like this:

/dev/sda2 * 638 12312 93773824 7 HPFS/NTFS

The important bit is the /dev/sda2 which tells us where the Windows partition is mounted. HPFS/NTFS lets us know that the partition is a Microsoft Windows formatted device, and that little star denotes that this is a bootable partition.

So in my case /dev/sda2 means that Windows is on sda (my internal hard drive) and that it’s partition 2 that I want to play around with.

Armed with this information you want to use NTFSProgs to attempt to fix the partition. In your Terminal window type:

sudo ntfsfix /dev/<device name>

Replace <device name> with your Windows partition (e.g. /dev/sda2) and enter your password followed by Enter. Your drive will now be mounted, checked for consistency and any errors found should be fixed. Restart your PC to assess the situation, if all goes well you’ll see Windows.

Fixing A Corrupt Master Boot Record

If you’ve got a problem with Windows’ oh-so-important boot record then you can also fix that from within Ubuntu too. Assuming you’ve already booted into Ubuntu, open up Terminal and install lilo by typing:

sudo apt-get install lilo

Enter your password to proceed with the installation, you’ll get a few warnings pop-up along the way.
If you followed the first part of this tutorial you’ll know which partition Windows is installed on, if you missed it type:

sudo fdisk -l

Find the HPFS/NTFS partition that relates to your Windows install, and type:

sudo lilo -M /dev/ mbr

Replace <device name> with your Windows partition (e.g. /dev/sda2) and hit Enter. Ubuntu will attempt to restore your master boot record. You’ll probably want to restart your machine now, just make sure you take any Live CD/USB devices out as you do.

Conclusion

If you’re still having problems with a Windows install, and you’ve tried everything then don’t forget you can mount the partition and rescue as much data as you think you’ll need. Using the terminal, enter:

sudo mkdir /media/windows

sudo ntfs-3g -o force,rw /dev/<device name> /media/windows

Replace <device name> with your Windows partition location and the drive should pop-up on your desktop.

Has Ubuntu saved your bacon recently? Do you dual-boot with Windows? Thinking about making a Live CD just in case? Let us know below.

Hello. I've followed every step of "Fixing A Corrupted Windows NTFS Partition" since I have a windows PC that cannot read it (although it sees it) but an ubuntu PC can read it perfectly. So... when I came to
sudo apt-get install ntfsprogs it gave me this message back (translating from italian):
"the packet ntfsprogs has no versions available, but it is called from another package. This may mean that the package is lacking, obsolete or only available within another source.
The package ntfsprogs has no candidates to be installed".
Anyway, I went forward and at the end, when I typed sudo ntfsfix /dev/sdc2 (the partition that is damaged) it returned me as follows:
Refusing to operate on read-write mounted device /dev/sdc2.
So... do you have any idea on how I should proceed? Thank you!

I use Linux as my only OS now, but have a ntfs partition on a raid0 disk array that suddenly vanished. I tried testdisk and various partition recovery software and they scanned for hours and just gave me jibberish and would even crash my machine during the scan!

One command from your article and 2 seconds later it was fixed.. *doh!*

Was dealing with this problem for almost 13 hours now... Finally i did fix it thanks to your post Thank You Very MUCH! also for the people who want to add Windows to the Grub list after you fix the partition just type in the Terminal: sudo update-grub

This will detect and add windows automatically to the list, and if you still facing problems then use boot-repair tool from Ubuntu. Thanks again. God Bless.

if your data is valuable to you you should never ever (try to) write to a corrupt filesystem ("fixing" == writing). boot linux from a removable device, mount the partition read-only and try to copy as much data as you can; if that is not possible, generate a disk-image with ddrescue or sth- like that.
generally, keep OS and user-data apart; best on two different disks (at least two partitions); windozw has to reinstalled qwuite often and this makes it much easier and more reliable.

if you disk is already unreliable it is a really dangeruous idea to install another OS on that; also messing with the mbr can render windoze completely useless.
a good tool for rescue is systemrescuecd http://www.sysresccd.org
(i'm just bit-by-bit-recovering a really bad disk for a friend who made this much harder by using ideas like the ones propesed here)

I forgot to mention. I specified the partition on the 320gb where Windows XP is installed, but it is telling me that it is refusing to do the operation. I can view all files on both partitions on the 320gb drive. It is just that Windows XP can't seem to locate its own partition and will not launch.

I tried ntfsfix and it did not work. I have I have a dual-boot system where I have Ubunto 10.04 on an 80gb hard drive configured as master and I have another 320gb drive configured as slave with two partitions, one containing Windows XP and the other is for data storage. Windows stopped launching, and claims it cannot find the drive where it is installed. When I boot into Linux, I can see both partitions of the 320gb drive. When I run sudo fdisk -l, all of the partitions on the 80gb drive where Linux resides are displayed, as well as all of the partions on the 320gb. But when I try to run ntfsfix, I just get an error message saying it is refusing to do the operation on that drive. Why is it refusing? Do Linux and Windows have to physically reside on the same hard drive in order for it to work?

I tried the fix you suggested but how could you fix this error:
"unable to read this file system. because of some operations may be unavailable. The cause might be a missing software package. the following list of software packages is required for ntfs file system support: ntfsprogs / ntfs-3g"

Thank you so much. I was in a llop where the BIOS did not see the system partition to boot from. I have been searching for and trying solutions for days and the sudo apt-get install ntfs-3g has now icked some life into my boot sequence.
I can now run win 7 from a usb to repair (I hope).
It did merge all of my partitions though so be aware of this beofre hand.

What a mess and all from a free download off CNET that my virus scan didn't catch. BE WARY!

Now to fix the issue with my external HD which is not visible to any OS.

Thanks a lot!!!
My pc is in dual boot win7/linux-mint. I had a problem with the pins of the CF-reader: from that moment on, win7 started refusing to boot. Also from the linux-mint system the ntfs partition was not accessible. I tried with the win7 recovery disk, but all I got was:
===
Root cause found:
System volume on disk is corrupt.
Repair action: File system repair (chkdsk)
Result: Failed. Error code = 0x1f
Time taken = 0 ms
===
Then I came here: from the terminal of my linux-mint I typed "sudo ntfsfix /dev/sda2" and in just 2 seconds the error was fixed.

"Find the HPFS/NTFS partition that relates to your Windows install, and type" l cant find any sda related to ntfs. l am trying ubuntu from a live USB image. The asterix shows my live USB drive. No other drive listed as sda...

Fantastic info , very well explained and helpful at least in my case ( I had an issue with an external 2T drive) . Much appreciate the help, you saved me hours of scanning through irrelevant info. Cheers.

BIG NOTE HERE!!!: ms-sys was taken out of the repositories back in Ubuntu 8.0.4. So many sites point to using ms-sys and say "just apt-get install it!" If you were wanting to use ms-sys to restore the MBR, you'd HAVE to download the source code, two libraries (I think), and compile it from source. I've done that one more than once to repair the MBR. A tool which IS included on the live CD (last I checked) is "install-mbr" and I believe I've had good luck with that tool [Broken Link Removed] The other option I've read (but not tried) is to repair it using lilo [Broken Link Removed]

BIG NOTE HERE!!!: ms-sys was taken out of the repositories back in Ubuntu 8.0.4. So many sites point to using ms-sys and say "just apt-get install it!" If you were wanting to use ms-sys to restore the MBR, you'd HAVE to download the source code, two libraries (I think), and compile it from source. I've done that one more than once to repair the MBR. A tool which IS included on the live CD (last I checked) is "install-mbr" and I believe I've had good luck with that tool (http://manpages.ubuntu.com/manpages/lucid/man8/install-mbr.8.html). The other option I've read (but not tried) is to repair it using lilo (http://ubuntuforums.org/showthread.php?p=6361212)