Anton Altaparmakov wrote:
> Hi,
>
> [CC:-ing ntfs-dev ML since this is really a developer issue.]
>
> On Thu, 2004-11-04 at 07:10, Ken MacFerrin wrote:
>
>>I have a PC setup to dual boot Gentoo Linux & WinXP Pro SP2 and continue
>>to have a segmentation fault when trying to mount one of my ntfs
>>partitions under linux. I've tried this with several 2.6.8 and 2.6.9
>>kernels (currently 2.6.9-gentoo-r1) and have had the same issue each
>>time. I've also tried this with the ntfs kernel driver complied both
>>monolithic and as a module (current).
>>
>>The issue is that I can mount one of my ntfs partitions without issue
>>but when trying to mount the XP OS partition (/dev/hda1) I receive a
>>"Segmentation Fault" error and the mount command exits. If I try to
>>mount it a second time then the command line just hangs.
>>
>>The odd part is that Windows boots just fine off this partition and I've
>>defragmented the drive and run chkdsk (with the 'fix errors' option)
>>multiple times under Win with no issues.
>>
>>I've provided some snipped dmesg output below while trying to mount at
>>boot with the following options in fstab:
>>/dev/hda1 /mnt/winxp ntfs auto,ro,owner,user,nosuid,nodev,umask=0227 0 0
>>
>>Since the partition works fine natively and I can cleanly mount my other
>>ntfs partition via linux I can't tell if there's genuinely an issue with
>>the partition or if this is a buggy error from the driver. Any suggestions?
>
>
> Yes! Thank you for the excellent bug report and error output. It is
> nice to get such a good bug report!
>
> There are two bugs. One that causes it to crash. (That one is just
> stupid error handling.) And one that causes it to think there is
> something corrupt and aborting the read even though the corruption is in
> mft record 0x12 while it is actually reading 0x10. This is really
> silly. Anyway, if you apply the attached patch, it will no longer
> crash. Could you do it and verify that it now does not crash? Thanks a
> lot!
>
> To apply the patch just: cd /usr/src/linux [or wherever the kernel is]
> and: patch -p1 < /path/to/ntfs-attr-fix1.diff
>
> After you have done that could you run chkdsk /f on that partition from
> windows and then try again mounting? Assuming it still fails it would
> be really useful to have a copy of the beginning of your $MFT system
> file so I can replicate the problem here. For this could you install
> the ntfsprogs package (if not available in gentoo, get it from
> http://linux-ntfs.sourceforge.net/downloads.html) and run:
>
> ntfscat -fi 0 /dev/hda1 > /tmp/mymft.dat
> (You can then compress the file with bzip2 -9 /tmpmymft.dat)
>
> If you could send me that or put it somewhere for me to download it
> would be great. If the file is too big for that than copy out the
> beginning like so:
>
> dd if=/tmp/mymft.dat of=/tmp/mymftbegin.dat bs=1024 count=32
> (Again can compress with bzip2 -9 /tmp/mymftbegin.dat)
>
[snip]
Anton,
Many thanks for your quick reply. I have applied the patch, recompiled
and then ran a chkdsk (under Win) on the /dev/hda1 partition.. The good
news is that when trying to mount under linux that mount no longer
segfaults or hangs. The bad news is that I am still unable to mount the
partition and get the errors listed below. Again, this same partition
still works fine natively. I'll copy you offline with a link to my MFT.
Again, any suggestions appreciated.
Thanks,
Ken
------------------------
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1):
ntfs_end_buffer_async_read(): post_read_mst_fixup() failed, corrupt mft
record 0x12. Run chkdsk.
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1):
map_mft_record_page(): Failed with error code 5.
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1): map_mft_record():
Failed with error code 5.
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1):
map_extent_mft_record(): Failed to map extent mft record, error code 5.
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1):
ntfs_external_attr_find(): Failed to map extent mft record 0x10 of base
inode 0x0. Unmount and run chkdsk.
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1):
ntfs_read_inode_mount(): Failed to lookup $MFT/$DATA attribute extent.
$MFT is corrupt. Run chkdsk.
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1):
ntfs_read_inode_mount(): Failed. Marking inode as bad.
Nov 4 20:40:35 [kernel] NTFS-fs error (device hda1): ntfs_fill_super():
Failed to load essential metadata.
Nov 4 20:41:31 [kernel] NTFS-fs error (device hda1):
ntfs_end_buffer_async_read(): post_read_mst_fixup() failed, corrupt mft
record 0x12. Run chkdsk.
Nov 4 20:41:31 [kernel] NTFS-fs error (device hda1):
map_mft_record_page(): Failed with error code 5.
--------------------
|