HOWTO: Fix an NTFS partition in Ubuntu

20Sep11

My HowTo on fixing an EXT partition in Ubuntu is by far my most popular post, pulling in new visitors everyday. The only reason I wrote it is because it was something that happened to me now and again.

But what about dual boots? What happens when your NTFS drive goes beserk, and you only have access to your Ubuntu install? Well, finally, I’ve come across a solution.

Now, before we begin, this HowTo assumes that your Ubuntu install is working as normal, and that the NTFS partition isn’t essential to Ubuntu. It’s also possible (though I’ve not yet tried) to follow this HowTo using Parted  Magic.

First, we need to find out what partition we are dealing with. To do this, open a terminal and type;

sudo fdisk -l

That’ll give you something like this;

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2709a320

 Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19457 156288321 7 HPFS/NTFS

/dev/sd1 is in this case the NTFS drive we’ll be working with. Obviously change this to whatever yours is. If your partition isn’t listed here, or appears to be the wrong size, you’ll need to use TestDisk.

Next, you need to install some software called “ntfsprogs”. You can do this through Synaptic or on the command line using;

sudo apt-get install ntfsprogs

There’s just one last step.

sudo ntfsfix /dev/sdb1

With any luck, you should see the following;


Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
NTFS volume version is 3.1.
NTFS partition /dev/sdb1 was processed successfully.

And that’s it! Go try to mount you NTFS partition, and it should work again as normal. If not, feel free to leave a comment below.

About these ads


17 Responses to “HOWTO: Fix an NTFS partition in Ubuntu”

  1. 1 Ron Bell

    I have followed your instructions faithfully in this article as well as the previous posting: HOWTO: Repair a broken Ext4 Superblock in Ubuntu

    No luck. The superblock numbers did not work.

    The Ubuntu 10.10 Disk Utility shows the MAXTOR partitition as Partition Type – Empty (0×00), Type – FAT (32 bit version), Device – dev/sdb1, and Mount Point – unmounted.

    Note: No RAID, no Windows on system. The second HD was originally created as ext4 drive and easily interchanged files with Win Vista PC.

    The Mount Volume returns “File system driver is not installed” and Check Filesystem says “The file system is NOT clean.”

    ron@Maverick:~$ sudo fdisk -l

    Disk /dev/sdb: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0003795d

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 29912 240267116 0 Empty
    /dev/sdb2 29913 30401 3927892+ 0 Empty

    ron@Maverick:~$ sudo ntfsfix /dev/sdb1
    Mounting volume… Failed to startup volume: Invalid argument.
    FAILED
    Attempting to correct errors… FAILED
    Failed to startup volume: Invalid argument.
    Volume is corrupt. You should run chkdsk.
    ron@Maverick:~$ sudo chkdsk /dev/sdb1
    sudo: chkdsk: command not found

    THANKS for your helpful articles.

    • 2 evidex

      Hmmm, ok. For a start, you mentioned that the drive is in ext4 format, however, the result from the disk utility says that it’s FAT32. The fact that you can access it through Windows also shows this (ext4 is incompatible with windows). So this HOWTO won’t be of much help to you. You’ll need to use some sort of fsck that works with fat32 type partitions. A bit of googling on “Repairing fat32 partitions” might shed some light on the situation

  2. 3 Peter

    Worked like a charm with my 2TB data disk in Ubuntu 11.04!
    Thanks! :-)

  3. 5 PJ

    Thanks a lot. It magically worked :)

  4. hi i need help

    Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x454c72f0

    Device Boot Start End Blocks Id System
    /dev/sde1 63 1953520064 976760001 7 HPFS/NTFS/exFAT

    aginor@eee:~$ sudo ntfsfix /dev/sde
    Mounting volume… NTFS signature is missing.
    FAILED
    Attempting to correct errors… NTFS signature is missing.
    FAILED
    Failed to startup volume: Invalid argument
    NTFS signature is missing.
    Trying the alternate boot sector
    Unrecoverable error
    Volume is corrupt. You should run chkdsk.

    • 7 evidex

      Try using sudo ntfsfix /dev/sde1 changing 1 to the number of the partition that’s affected.

  5. 8 Balask

    not working for me either

    ******@Ubuntu:~$ sudo ntfsfix /dev/sdb2
    [sudo] password for ******:
    Mounting volume… ntfs_mst_post_read_fixup_warn: magic: 0×43425355 size: 1024 usa_ofs: 1217 usa_count: 65535: Invalid argument
    ntfs_mst_post_read_fixup_warn: magic: 0×43425355 size: 1024 usa_ofs: 1218 usa_count: 65535: Invalid argument
    ntfs_mst_post_read_fixup_warn: magic: 0×00000001 size: 1024 usa_ofs: 1 usa_count: 65535: Invalid argument
    Record 6 has no FILE magic (0×1)
    Failed to open inode FILE_Bitmap: Input/output error
    FAILED
    Attempting to correct errors…
    Processing $MFT and $MFTMirr…
    Reading $MFT… ntfs_mst_post_read_fixup_warn: magic: 0×43425355 size: 1024 usa_ofs: 1217 usa_count: 65535: Invalid argument
    OK
    Reading $MFTMirr… ntfs_mst_post_read_fixup_warn: magic: 0×43425355 size: 1024 usa_ofs: 1218 usa_count: 65535: Invalid argument
    OK
    Comparing $MFTMirr to $MFT… OK
    Processing of $MFT and $MFTMirr completed successfully.
    Setting required flags on partition… ntfs_mst_post_read_fixup_warn: magic: 0×43425355 size: 1024 usa_ofs: 1217 usa_count: 65535: Invalid argument
    Record 3 has no FILE magic (0×43425355)
    Failed to read $Volume: Input/output error
    FAILED
    Error setting volume flags.

  6. 9 Ryan

    I just followed the instructions to the letter, and it said that it was processed succesful, but the file system still isn’t clean, and the drive still won’t mount

  7. 11 Windy time

    You are a legend with me! Thank you so much! Keep going with such wonderful posts!

  8. 12 Blwd

    Fixed my laptop’s drive with help of this guide, as my windows couldnt boot up at all. Now it runs like charm for while. might turn over to ubuntu completely and screw the w7.

  9. Good article, learning, collectors!

  10. 14 Ian

    Thankfully this worked for me.

    Mounting volume… $MFTMirr does not match $MFT (record 0).
    FAILED
    Attempting to correct errors…
    Processing $MFT and $MFTMirr…
    Reading $MFT… OK
    Reading $MFTMirr… OK
    Comparing $MFTMirr to $MFT… FAILED
    Correcting differences in $MFTMirr record 0…OK
    Processing of $MFT and $MFTMirr completed successfully.
    Setting required flags on partition… OK
    Going to empty the journal ($LogFile)… OK
    NTFS volume version is 3.1.
    NTFS partition /dev/sdb2 was processed successfully.

    Was able then to mount partition.
    Thanks.

  11. 15 nap

    Thanks for this guide. Just fixed an inaccessible USB NTFS hdd. The hdd is just one day old so I better observe if it’s a hardware problem or it was caused by (me) moving the USB hdd while transferring files (I was too excited to stick labels onto the hdd case). :) The USB cable might have gone loose while moving the hdd.

  12. Didn’t work for me :(

    ubuntu@ubuntu:~$ sudo ntfsfix /dev/sda1
    Refusing to operate on read-write mounted device /dev/sda1.

  13. 17 piyush

    i was copy some data to my external hard disk from my system but it was stopped in between and i remove the hard wihtout unmount it…….and when i again plug it ,it is showing this error:

    Error mounting: mount exited with exit code 13: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
    Failed to read NTFS $Bitmap: Input/output error
    NTFS is either inconsistent, or there is a hardware fault, or it’s a
    SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
    then reboot into Windows twice. The usage of the /f parameter is very
    important! If the device is a SoftRAID/FakeRAID then first activate
    it and mount a different device under the /dev/mapper/ directory, (e.g.
    /dev/mapper/nvidia_eahaabcc1). Please see the ‘dmraid’ documentation
    for more details.



Follow

Get every new post delivered to your Inbox.

Join 67 other followers

%d bloggers like this: