首页 > Linux > How to fix ‘$MFTMirr does not match $MFT (record 0)’

How to fix ‘$MFTMirr does not match $MFT (record 0)’

2011年7月26日 Code007

Sometimes, when you are executing a file transfer between your computer hard drive and an external drive and your computer shutdown for some reason (in my case, no battery/ac power) it’s pretty common to get some errors on external drives that uses NTFS as they file system.

The most common message is:

Error mounting: mount exited with exit code 13: $MFTMirr does not match $MFT (record 0).
Failed to mount ‘/dev/sdb3′: 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.

One workaround for this issue is to do as the message says, boot on Windows and try to use the awesome NTFS tool that Windows offer. But a perfect solution for a Linux users is to use the ntfsprogs utility.

ntfsprogs is a suite of NTFS utilities based around a shared library. The tools are available for free and come with full source code.

  • mkntfs: Create an NTFS volume on a partition
  • ntfscat: Print a file on the standard output
  • ntfsclone: Efficiently backup/restore a volume at the sector level
  • ntfscluster: Given a cluster, or sector, find the file
  • ntfsfix: Forces Windows to check NTFS at boot time
  • ntfsinfo: Dump a file’s attributes, completely
  • ntfslabel: Display or set a volume’s label
  • ntfslib: Move all the common code into a shared library
  • ntfsls: List directory contents
  • ntfsresize: Resize an NTFS volume
  • ntfsundelete: Find files that have been deleted and recover them
  • ntfswipe: Write zeros over the unused parts of the disk
  • ntfsdefrag: Defragment files, directories and the MFT
  • ntfsck: Perform consistancy checks on a volume
  • nttools: Command-line tools to view/change an offline NTFS volume, e.g. ntfscp, ntfsgrep, ntfstouch, ntfsrm, ntfsrmdir, ntfsmkdir
  • ntfsdiskedit: Walk the tree of NTFS ondisk structures (and alter them)

Be careful with these utilities, they might damage the filesystem, or your hard disk !

With ntfsprogs installed (sudo apt-get install ntfsprogs) you should execute the following commands in a terminal:

sudo ntfsfix /dev/partitionName

After this command you should expect the following output:

~$ sudo ntfsfix /dev/sdb3
Mounting volume... 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/sdb3 was processed successfully.

After this step you should be able to access your external drive partition as usual, mount or use nautilus to access your files.

Source:  http://gnuwin32.sourceforge.net/packages/ntfsprogs.htm

From:http://wmarkito.wordpress.com/2010/12/29/how-to-fix-mftmirr-does-not-match-mft-record-0/

 

MyLog

 

code007@code007:~$ sudo fdisk -l

Disk /dev/sda: 640.1 GB, 640135028736 bytes
183 heads, 13 sectors/track, 525541 cylinders
Units = cylinders of 2379 * 512 = 1218048 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00001198

Device Boot      Start         End      Blocks   Id  System
/dev/sda2            6727      343002   399998977    5  Extended
/dev/sda5            6727      343002   399998976   83  Linux

Disk /dev/sdb: 640.1 GB, 640135026688 bytes
255 heads, 63 sectors/track, 77825 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: 0xf1d5f1d5

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       12749   102406311    7  HPFS/NTFS
/dev/sdb2           12750       77825   522722970    f  W95 Ext’d (LBA)
/dev/sdb5           12750       31872   153605466    7  HPFS/NTFS
/dev/sdb6           31873       50995   153605466    7  HPFS/NTFS
/dev/sdb7           50996       77825   215511943+   7  HPFS/NTFS
code007@code007:~$ sudo ntfsfix /dev/sdb
sdb   sdb1  sdb2  sdb5  sdb6  sdb7
code007@code007:~$ sudo ntfsfix /dev/sdb
sdb   sdb1  sdb2  sdb5  sdb6  sdb7
code007@code007:~$ sudo ntfsfix /dev/sdb1
Mounting volume… 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
Error: Volume name could not be converted to current locale: Invalid or incomplete multibyte or wide character.
NTFS volume version is 3.1.
NTFS partition /dev/sdb1 was processed successfully.
code007@code007:~$

分类: Linux 标签:
  1. 本文目前尚无任何评论.
  1. 2013年6月6日13:49 | #1
本文的评论功能被关闭了.