Pinterest Stumbleupon Whatsapp
Ads by Google

ubuntu fixing ntfs filesystemHow 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.

Me too, and much of the time the original Windows CD/DVD How To Make Your Own Windows Live CD How To Make Your Own Windows Live CD Read More /USB How To Install Windows 7 On Netbook From A USB Drive How To Install Windows 7 On Netbook From A USB Drive Read More you used in your original install can’t fix the problem. You need something else. Something like a whole operating system, either installed on a separate partition or in Live CD/USB format. Enter Ubuntu Ubuntu 10.04 - An Extremely Simple Operating System [Linux] Ubuntu 10.04 - An Extremely Simple Operating System [Linux] Read More !


There’s a good few 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.

When it comes to fixing your broken Windows install then Ubuntu has its uses there too. If you happen to break your registry Top 5 Freeware Registry Cleaners That Improve PC Performance Top 5 Freeware Registry Cleaners That Improve PC Performance Read More or master boot record, then fear not – all is not lost. This technique should work on any Ubuntu-based Linux distributions Why Are There So Many Versions of Ubuntu? [Technology Explained] Why Are There So Many Versions of Ubuntu? [Technology Explained] Read More .

Download, Install & Boot Ubuntu

Those of you who already have a dual-boot Ubuntu and Windows How to Set Up a Dual Boot Windows & Linux System with Wubi How to Set Up a Dual Boot Windows & Linux System with Wubi Read More machine can skip this step.

If you’ve not got a Live USB stick then you’re going to need to get hold of one. UNetbootin How To Install Linux With Ease Using UNetbootin How To Install Linux With Ease Using UNetbootin We've already talked about Linux and why you should try it, but probably the hardest part of getting used to Linux is getting it in the first place. For Windows users, the simplest way is... Read More is a useful tool which enables you to create a USB stick with a bootable version of your favourite open source operating system preloaded. If you’d prefer to use a CD, download an Ubuntu disk image and burn it with ImgBurn ImgBurn - Easy & Free CD and DVD Burner App ImgBurn - Easy & Free CD and DVD Burner App Read More .

Ads by Google

ubuntu fixing ntfs filesystem

If you’re dual-booting, then this is a simple step of choosing Ubuntu over Windows at boot. For Live USB sticks 100 Portable Apps for your USB Stick (for Mac and Win) 100 Portable Apps for your USB Stick (for Mac and Win) Read More and CDs you’re going to need to enter the BIOS setup as your PC boots (usually by pressing F2 or Del) and arrange your boot devices to prioritize your USB device or CD drive to boot before your main hard drive.

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
ubuntu fixing ntfs filesystem

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
rescue ntfs filesystem from linux

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>
rescue ntfs filesystem from linux

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.

rescue ntfs filesystem from linux

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.

  1. Luis Rojas
    October 20, 2016 at 12:32 pm

    What do I have to do if instead of LILO I have Grub? It 's the same procedure?

  2. Mioced
    October 2, 2016 at 5:07 pm

    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.

  3. Lazza
    August 20, 2016 at 12:28 pm

    The "ntfsfix" command does NOT "fix" corrupted NTFS partitions, it only manages very small errors related to the dirty bit. For serious NTFS recovery you need something else:

    http://askubuntu.com/a/776317/271

  4. sholem
    June 9, 2016 at 11:05 am

    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)

  5. Matt
    February 5, 2016 at 3:10 pm

    NTFSPROGS not a valid package anymore?

    • Seth
      February 9, 2016 at 2:51 am

      ntfsprogs has been merged with ntfs-3g.

  6. Ihor
    January 21, 2016 at 9:16 pm

    Thank you man! Helps a lot!!!

  7. ammaro
    January 11, 2016 at 2:33 pm

    Thanks so much

  8. Abdolrahman
    January 4, 2016 at 9:01 am

    thank you very much dude...
    ubuntu fixed the broken partition ..

    respect...

  9. Sebastian Fudali
    October 31, 2015 at 7:24 pm

    I get this error:
    Refusing to operate on read-write mounted device /dev/sde2.

  10. Steven Trott
    August 18, 2015 at 4:05 am

    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.

  11. Steven Trott
    August 18, 2015 at 4:02 am

    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?

  12. Christopher
    May 21, 2015 at 6:20 pm

    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"

  13. AbdulHakim
    May 7, 2015 at 2:17 pm

    Thanks mate! You really helped me out. You may also want to mention that all tthis doen't even need access to the Internet to download anything. Using Ubuntu 8.04 live disk.

  14. marco
    April 24, 2015 at 11:37 pm

    I did ntfsfix, and lilo, but my hard disk continues not booting on windows. i´m now trying to copy as much as i can. bu, hey! thank you a lot!

  15. Adan
    April 18, 2015 at 9:11 pm

    Thenk you so much!!!!

  16. Gav
    March 29, 2015 at 9:58 pm

    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 again

  17. Tracy
    February 24, 2015 at 3:50 am

    Hi there,

    I have a 2TB portable external drive showing suddenly as "raw". Testdisk says file system is corrupt.

    Cannot find ntfsprogs- says not available using apt-get?

    Any hope here? I'm running Mint Mate 17.1 but have access to Windows & Minitool Data Recovery licenced version. Just trying for a MFT/MBR fix first, rather than multi-hours of recovery files to sort through.

    Help??

  18. Brune Wayce
    February 14, 2015 at 5:17 pm

    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.

    Really thanks!!!
    BW

  19. jinky
    February 2, 2015 at 6:00 pm

    How can i fix a windows partition gone Raw what commands can i use I have a HBCD can i use that
    jinky

  20. bijen tongbram
    January 17, 2015 at 9:07 am

    i have done watever you the steps you mentioned here but what i want to know is how to replace the device name at the end...please tell me

  21. cuma rooksy
    January 7, 2015 at 2:20 pm

    "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...

  22. Karthik
    January 6, 2015 at 8:13 pm

    when i give the command "sudo fdisk =l" i get this below message. how to proceed with it? help..

    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

    any ways out?? im using windows 8.1 which is corrupted and refusing to load with winload.exe corrupted.
    using ubuntu live from usb

  23. Napoleon Gikas
    January 4, 2015 at 4:13 pm

    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.

    • Tim Brookes
      January 4, 2015 at 11:54 pm

      Wow, this article was published in Sept 2010 – very pleased that the information is still relevant and could help you solve your issue :)

  24. Grogan Ryan
    December 3, 2010 at 10:36 pm

    I Had The Cd Come, I Did Try It, It Works, But You Can't Download Anything.

  25. Jesper
    December 1, 2010 at 8:53 pm

    Thanks - that was just what i neded to "Fix A Corrupted Windows NTFS Partition" -wooderfull, it saved me at least 24 hours of reinstalling.

    Many thanks
    Jesper

  26. Jesper
    December 1, 2010 at 9:53 pm

    Thanks - that was just what i neded to "Fix A Corrupted Windows NTFS Partition" -wooderfull, it saved me at least 24 hours of reinstalling.

    Many thanks
    Jesper

  27. Icerabbitje
    November 28, 2010 at 9:20 pm

    Unable to locate package ntfs-g

    New to Ubuntu. Latest ubuntu 10.10 running on flash drive to fix an ailing netbook ...

    • Tim Brookes
      November 28, 2010 at 10:00 pm

      It's actually:

      sudo apt-get install ntfs-3g

      Probably why you can't find it! Though I wrote this for 10.04, I'm fairly sure it should still work with the latest build.

  28. Tim Brookes
    November 28, 2010 at 11:00 pm

    It's actually:

    sudo apt-get install ntfs-3g

    Probably why you can't find it! Though I wrote this for 10.04, I'm fairly sure it should still work with the latest build.

  29. Bob
    October 27, 2010 at 3:03 am

    thanks, I made a guess it was possible to recover an NTFS partition, did a web search and bam it worked! nice!

  30. Bob
    October 27, 2010 at 1:03 am

    thanks, I made a guess it was possible to recover an NTFS partition, did a web search and bam it worked! nice!

  31. aer conditionat
    September 23, 2010 at 10:54 pm

    thanks for this, i had a problem with master boot record and it's solved

  32. TLW
    September 23, 2010 at 10:42 pm

    Okay. I'm sold. When I fired up my pc, 30 minutes ago, she went into fixing file mode. I'm no geek. However, I know bad when I see it :)

  33. Basie
    September 23, 2010 at 8:05 pm

    Ubuntu works!! Had a laptop with Vista and could not boot or access recovery partition. Booted wih Ubuntu sticks and could recover all data. A have to have.

  34. Tim Brookes
    September 23, 2010 at 6:11 pm

    It appears the ms-sys package has been removed from the repositories due to licensing issues, so instead I'm putting up instructions for lilo. You can install it by opening the Terminal and typing:

    sudo apt-get install lilo

    Then repair your MBR by typing:

    sudo lilo -m /dev/"device name" mbr

    The article will be updated soon, hope this helps.

  35. Tim Brookes
    September 23, 2010 at 6:07 pm

    Well spotted, the article will be amended shortly with instuctions for lilo.

    ms-sys was removed from the repositories a while ago due to licensing issues.

  36. Steve
    September 23, 2010 at 3:35 pm

    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/man... The other option I've read (but not tried) is to repair it using lilo (http://ubuntuforums.org/showth...

  37. Steve
    September 23, 2010 at 1:35 pm

    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)

    • Tim Brookes
      September 23, 2010 at 4:07 pm

      Well spotted, the article will be amended shortly with instuctions for lilo.

      ms-sys was removed from the repositories a while ago due to licensing issues.

  38. Luigi Cavallo
    September 23, 2010 at 1:25 pm

    With Windows 7 and Vista using BCD as a means of booting the OS, do these tools help to recover from a corrupted BCD>

  39. stan reichardt
    September 23, 2010 at 2:54 pm

    Article nicely written and quite understandable.

    I'm using Ubuntu 10.04.1 with current updates. Am not able to locate the "ms-sys" package in US repositories. Where can I find it?

    Why use "force, rw" options if you are only going to back-up data? Isn't that a bit risky to an already fragile system?

  40. stan reichardt
    September 23, 2010 at 12:54 pm

    Article nicely written and quite understandable.

    I'm using Ubuntu 10.04.1 with current updates. Am not able to locate the "ms-sys" package in US repositories. Where can I find it?

    Why use "force, rw" options if you are only going to back-up data? Isn't that a bit risky to an already fragile system?

    • Tim Brookes
      September 23, 2010 at 4:11 pm

      It appears the ms-sys package has been removed from the repositories due to licensing issues, so instead I'm putting up instructions for lilo. You can install it by opening the Terminal and typing:

      sudo apt-get install lilo

      Then repair your MBR by typing:

      sudo lilo -m /dev/"device name" mbr

      The article will be updated soon, hope this helps.

  41. Saptashwa
    September 23, 2010 at 12:43 pm

    Already done these things.....

  42. Jasjeev Singh Anand
    September 23, 2010 at 11:53 am

    Just the sort o thing I needed. Gonna give it try.

  43. Sasha Karasev
    September 23, 2010 at 7:49 am

    thank you

  44. Accommodation in Cannes
    September 23, 2010 at 9:11 am

    This is a really excellent read for me. Must admit that you are one of the best blogger I ever saw. Thanks for posting this useful article.

  45. pceasies
    September 23, 2010 at 1:00 am

    Windows CD/DVD has always worked using chkdsk and fixmbr. Might give it a try in the future as a last ditch effort.

Leave a Reply

Your email address will not be published. Required fields are marked *