 |
|
Page 1 of 1
|
[ 9 posts ] |
|
"Input/output error" and corruption after truncation
| Author |
Message |
|
glenn.ammons
Joined: Fri Mar 13, 2009 21:19 Posts: 6
|
 "Input/output error" and corruption after truncation
NTFS-3G returns an "Input/output error" and corrupts the filesystem when truncating certain files in a fresh install of Windows XP. Here is a shell transcript that demonstrates the problem: Quote: $ sudo ntfs-3g -o debug /dev/loop0 /tmp/mnt > /tmp/ntfs-3g.out 2>&1 $ ls -l /tmp/mnt/WINDOWS/bootstat.dat -rwxrwxrwx 1 root root 2048 2009-02-26 00:12 /tmp/mnt/WINDOWS/bootstat.dat $ getfattr -h -e hex -n system.ntfs_attrib '/tmp/mnt/WINDOWS/bootstat.dat' getfattr: Removing leading '/' from absolute path names # file: tmp/mnt/WINDOWS/bootstat.dat system.ntfs_attrib=0x24000000
$ > /tmp/mnt/WINDOWS/bootstat.dat bash: /tmp/mnt/WINDOWS/bootstat.dat: Input/output error $ ls -l /tmp/mnt/WINDOWS/bootstat.dat prwxrwxrwx 1 root root 0 2009-03-13 15:20 /tmp/mnt/WINDOWS/bootstat.dat $ getfattr -h -e hex -n system.ntfs_attrib '/tmp/mnt/WINDOWS/bootstat.dat' getfattr: Removing leading '/' from absolute path names # file: tmp/mnt/WINDOWS/bootstat.dat system.ntfs_attrib=0x24000000
Notice the "Input/output error" and that, after truncation, the file becomes a pipe. This is on Ubuntu Intrepid. I used the "Advanced Features" release ntfs-3g-2009.2.1AA.5 to generate the transcript but I have seen the same problem with the latest stable release. This happens with 21 files in the filesystem, all of which have "system.ntfs_attrib" set to 0x24000000. Here's the complete list of fishy files: Quote: Documents and Settings/All Users/Application Data/Microsoft/Crypto/RSA/S-1-5-18/d42cc0c3858a58db2db37658219e6400_56183be6-839b-48fa-a898-42e2507b1bcc WINDOWS/bootstat.dat WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/FP4.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/HPCRDP.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/IASNT4.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/IMS.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/MAPIMIG.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/mediactr.cat WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/MSMSGS.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/msn7.cat WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/msn9.cat WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/MSTSWEB.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/MW770.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/netfx.cat WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/NT5.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/NT5IIS.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/NT5INF.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/NTPRINT.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/OEMBIOS.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/SP2.CAT WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/tabletpc.cat WINDOWS/system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE}/wmerrenu.cat
The debug output from ntfs-3g is below. I don't see any errors in the system logs under /var/log. Please let me know if you need more information. Thanks. --glenn Quote: Version 2009.2.1AA.5 integrated FUSE 27 Mounted /dev/loop0 (Read-Write, label "", NTFS 3.1) Cmdline options: debug Mount options: silent,allow_other,nonempty,relatime,fsname=/dev/loop0,blkdev,blksize=4096 No user mapping file : ownership and permissions disabled unique: 1, opcode: INIT (26), nodeid: 0, insize: 56 INIT: 7.9 flags=0x0000003b max_readahead=0x00020000 INIT: 7.8 flags=0x00000001 max_readahead=0x00020000 max_write=0x00020000 unique: 1, error: 0 (Success), outsize: 40 unique: 2, opcode: LOOKUP (1), nodeid: 1, insize: 47 LOOKUP /.Trash unique: 2, error: -2 (No such file or directory), outsize: 16 unique: 3, opcode: LOOKUP (1), nodeid: 1, insize: 52 LOOKUP /.Trash-1000 unique: 3, error: -2 (No such file or directory), outsize: 16 unique: 4, opcode: LOOKUP (1), nodeid: 1, insize: 47 LOOKUP /.Trash unique: 4, error: -2 (No such file or directory), outsize: 16 unique: 5, opcode: LOOKUP (1), nodeid: 1, insize: 52 LOOKUP /.Trash-1000 unique: 5, error: -2 (No such file or directory), outsize: 16 unique: 6, opcode: STATFS (17), nodeid: 1, insize: 40 unique: 6, error: 0 (Success), outsize: 96 unique: 7, opcode: GETATTR (3), nodeid: 1, insize: 56 unique: 7, error: 0 (Success), outsize: 112 unique: 8, opcode: GETATTR (3), nodeid: 1, insize: 56 unique: 8, error: 0 (Success), outsize: 112 unique: 9, opcode: STATFS (17), nodeid: 1, insize: 40 unique: 9, error: 0 (Success), outsize: 96 unique: 10, opcode: GETATTR (3), nodeid: 1, insize: 56 unique: 10, error: 0 (Success), outsize: 112 unique: 11, opcode: GETATTR (3), nodeid: 1, insize: 56 unique: 11, error: 0 (Success), outsize: 112 unique: 12, opcode: LOOKUP (1), nodeid: 1, insize: 48 LOOKUP /WINDOWS NODEID: 2 unique: 12, error: 0 (Success), outsize: 136 unique: 13, opcode: OPENDIR (27), nodeid: 2, insize: 48 unique: 13, error: 0 (Success), outsize: 32 unique: 14, opcode: GETATTR (3), nodeid: 2, insize: 56 unique: 14, error: 0 (Success), outsize: 112 unique: 15, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 15, error: 0 (Success), outsize: 4112 unique: 16, opcode: LOOKUP (1), nodeid: 2, insize: 53 LOOKUP /WINDOWS/bootstat.dat NODEID: 3 unique: 16, error: 0 (Success), outsize: 136 unique: 17, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 17, error: 0 (Success), outsize: 112 unique: 18, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 18, error: 0 (Success), outsize: 112 unique: 19, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 19, error: 0 (Success), outsize: 128 unique: 20, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 20, error: 0 (Success), outsize: 16 unique: 21, opcode: RELEASEDIR (29), nodeid: 2, insize: 64 unique: 21, error: 0 (Success), outsize: 16 unique: 22, opcode: OPENDIR (27), nodeid: 2, insize: 48 unique: 22, error: 0 (Success), outsize: 32 unique: 23, opcode: GETATTR (3), nodeid: 2, insize: 56 unique: 23, error: 0 (Success), outsize: 112 unique: 24, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 24, error: 0 (Success), outsize: 4112 unique: 25, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 25, error: 0 (Success), outsize: 112 unique: 26, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 26, error: 0 (Success), outsize: 112 unique: 27, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 27, error: 0 (Success), outsize: 128 unique: 28, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 28, error: 0 (Success), outsize: 16 unique: 29, opcode: RELEASEDIR (29), nodeid: 2, insize: 64 unique: 29, error: 0 (Success), outsize: 16 unique: 30, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 30, error: 0 (Success), outsize: 112 unique: 31, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 31, error: 0 (Success), outsize: 112 unique: 32, opcode: GETXATTR (22), nodeid: 3, insize: 65 unique: 32, error: -61 (No data available), outsize: 16 unique: 33, opcode: GETXATTR (22), nodeid: 3, insize: 72 unique: 33, error: -95 (Operation not supported), outsize: 16 unique: 34, opcode: LOOKUP (1), nodeid: 1, insize: 48 LOOKUP /WINDOWS NODEID: 2 unique: 34, error: 0 (Success), outsize: 136 unique: 35, opcode: LOOKUP (1), nodeid: 2, insize: 53 LOOKUP /WINDOWS/bootstat.dat NODEID: 3 unique: 35, error: 0 (Success), outsize: 136 unique: 36, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 36, error: 0 (Success), outsize: 112 unique: 37, opcode: GETXATTR (22), nodeid: 3, insize: 67 unique: 37, error: 0 (Success), outsize: 24 unique: 38, opcode: GETXATTR (22), nodeid: 3, insize: 67 unique: 38, error: 0 (Success), outsize: 20 unique: 39, opcode: OPENDIR (27), nodeid: 1, insize: 48 unique: 39, error: 0 (Success), outsize: 32 unique: 40, opcode: GETATTR (3), nodeid: 1, insize: 56 unique: 40, error: 0 (Success), outsize: 112 unique: 41, opcode: READDIR (28), nodeid: 1, insize: 80 unique: 41, error: 0 (Success), outsize: 592 unique: 42, opcode: LOOKUP (1), nodeid: 1, insize: 48 LOOKUP /WINDOWS NODEID: 2 unique: 42, error: 0 (Success), outsize: 136 unique: 43, opcode: GETATTR (3), nodeid: 2, insize: 56 unique: 43, error: 0 (Success), outsize: 112 unique: 44, opcode: GETATTR (3), nodeid: 2, insize: 56 unique: 44, error: 0 (Success), outsize: 112 unique: 45, opcode: READDIR (28), nodeid: 1, insize: 80 unique: 45, error: 0 (Success), outsize: 16 unique: 46, opcode: RELEASEDIR (29), nodeid: 1, insize: 64 unique: 46, error: 0 (Success), outsize: 16 unique: 47, opcode: OPENDIR (27), nodeid: 1, insize: 48 unique: 47, error: 0 (Success), outsize: 32 unique: 48, opcode: GETATTR (3), nodeid: 1, insize: 56 unique: 48, error: 0 (Success), outsize: 112 unique: 49, opcode: READDIR (28), nodeid: 1, insize: 80 unique: 49, error: 0 (Success), outsize: 592 unique: 50, opcode: READDIR (28), nodeid: 1, insize: 80 unique: 50, error: 0 (Success), outsize: 16 unique: 51, opcode: RELEASEDIR (29), nodeid: 1, insize: 64 unique: 51, error: 0 (Success), outsize: 16 unique: 52, opcode: OPENDIR (27), nodeid: 1, insize: 48 unique: 52, error: 0 (Success), outsize: 32 unique: 53, opcode: GETATTR (3), nodeid: 1, insize: 56 unique: 53, error: 0 (Success), outsize: 112 unique: 54, opcode: READDIR (28), nodeid: 1, insize: 80 unique: 54, error: 0 (Success), outsize: 592 unique: 55, opcode: READDIR (28), nodeid: 1, insize: 80 unique: 55, error: 0 (Success), outsize: 16 unique: 56, opcode: RELEASEDIR (29), nodeid: 1, insize: 64 unique: 56, error: 0 (Success), outsize: 16 unique: 57, opcode: GETATTR (3), nodeid: 2, insize: 56 unique: 57, error: 0 (Success), outsize: 112 unique: 58, opcode: LOOKUP (1), nodeid: 1, insize: 48 LOOKUP /WINDOWS NODEID: 2 unique: 58, error: 0 (Success), outsize: 136 unique: 59, opcode: OPENDIR (27), nodeid: 2, insize: 48 unique: 59, error: 0 (Success), outsize: 32 unique: 60, opcode: GETATTR (3), nodeid: 2, insize: 56 unique: 60, error: 0 (Success), outsize: 112 unique: 61, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 61, error: 0 (Success), outsize: 4112 unique: 62, opcode: LOOKUP (1), nodeid: 2, insize: 53 LOOKUP /WINDOWS/bootstat.dat NODEID: 3 unique: 62, error: 0 (Success), outsize: 136 unique: 63, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 63, error: 0 (Success), outsize: 112 unique: 64, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 64, error: 0 (Success), outsize: 112 unique: 65, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 65, error: 0 (Success), outsize: 128 unique: 66, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 66, error: 0 (Success), outsize: 16 unique: 67, opcode: RELEASEDIR (29), nodeid: 2, insize: 64 unique: 67, error: 0 (Success), outsize: 16 unique: 68, opcode: OPENDIR (27), nodeid: 2, insize: 48 unique: 68, error: 0 (Success), outsize: 32 unique: 69, opcode: GETATTR (3), nodeid: 2, insize: 56 unique: 69, error: 0 (Success), outsize: 112 unique: 70, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 70, error: 0 (Success), outsize: 4112 unique: 71, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 71, error: 0 (Success), outsize: 112 unique: 72, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 72, error: 0 (Success), outsize: 112 unique: 73, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 73, error: 0 (Success), outsize: 128 unique: 74, opcode: READDIR (28), nodeid: 2, insize: 80 unique: 74, error: 0 (Success), outsize: 16 unique: 75, opcode: RELEASEDIR (29), nodeid: 2, insize: 64 unique: 75, error: 0 (Success), outsize: 16 unique: 76, opcode: GETATTR (3), nodeid: 3, insize: 56 unique: 76, error: 0 (Success), outsize: 112 unique: 77, opcode: LOOKUP (1), nodeid: 1, insize: 48 LOOKUP /WINDOWS NODEID: 2 unique: 77, error: 0 (Success), outsize: 136 unique: 78, opcode: LOOKUP (1), nodeid: 2, insize: 53 LOOKUP /WINDOWS/bootstat.dat NODEID: 3 unique: 78, error: 0 (Success), outsize: 136 unique: 79, opcode: SETATTR (4), nodeid: 3, insize: 128 unique: 79, error: 0 (Success), outsize: 112 unique: 80, opcode: LOOKUP (1), nodeid: 1, insize: 48 LOOKUP /WINDOWS NODEID: 2 unique: 80, error: 0 (Success), outsize: 136 unique: 81, opcode: FORGET (2), nodeid: 3, insize: 48 FORGET 3/4 delete: 3 unique: 82, opcode: LOOKUP (1), nodeid: 2, insize: 53 LOOKUP /WINDOWS/bootstat.dat NODEID: 4 unique: 82, error: 0 (Success), outsize: 136 unique: 83, opcode: GETATTR (3), nodeid: 4, insize: 56 unique: 83, error: 0 (Success), outsize: 112 unique: 84, opcode: GETXATTR (22), nodeid: 4, insize: 65 unique: 84, error: -61 (No data available), outsize: 16 unique: 85, opcode: GETXATTR (22), nodeid: 4, insize: 72 unique: 85, error: -95 (Operation not supported), outsize: 16 unique: 86, opcode: LOOKUP (1), nodeid: 1, insize: 48 LOOKUP /WINDOWS NODEID: 2 unique: 86, error: 0 (Success), outsize: 136 unique: 87, opcode: LOOKUP (1), nodeid: 2, insize: 53 LOOKUP /WINDOWS/bootstat.dat NODEID: 4 unique: 87, error: 0 (Success), outsize: 136 unique: 88, opcode: GETATTR (3), nodeid: 4, insize: 56 unique: 88, error: 0 (Success), outsize: 112 unique: 89, opcode: GETXATTR (22), nodeid: 4, insize: 67 unique: 89, error: 0 (Success), outsize: 24 unique: 90, opcode: GETXATTR (22), nodeid: 4, insize: 67 unique: 90, error: 0 (Success), outsize: 20 unique: 91, opcode: FORGET (2), nodeid: 4, insize: 48 FORGET 4/2 delete: 4 unique: 92, opcode: FORGET (2), nodeid: 2, insize: 48 FORGET 2/7 delete: 2 unique: 93, opcode: FORGET (2), nodeid: 1, insize: 48 FORGET 1/1 unique: 94, opcode: DESTROY (38), nodeid: 0, insize: 40 Unmounting /dev/loop0 () unique: 94, error: 0 (Success), outsize: 16
|
| Fri Mar 13, 2009 21:39 |
|
 |
|
jpa
NTFS-3G Lead Developer
Joined: Tue Sep 04, 2007 17:22 Posts: 1013
|
 Re: "Input/output error" and corruption after truncation
Hi Glenn,
What you see appears to me to comply with the specifications. A pipe is a "file" with SYSTEM attribute, no HIDDEN attribute and no data (zero size).
Originally your file (small endian attrib=0x24000000) was SYSTEM, not HIDDEN, and by truncating it you made it a pipe.
Now, maybe some extra check should be done to avoid this unexpected behaviour.
Please confirm you had no other corruption (lost cluster or whatever detected by chkdsk).
Regards
Jean-Pierre
|
| Fri Mar 13, 2009 22:23 |
|
 |
|
glenn.ammons
Joined: Fri Mar 13, 2009 21:19 Posts: 6
|
 Re: "Input/output error" and corruption after truncation
jpa wrote: Hi Glenn,
What you see appears to me to comply with the specifications. A pipe is a "file" with SYSTEM attribute, no HIDDEN attribute and no data (zero size).
Originally your file (small endian attrib=0x24000000) was SYSTEM, not HIDDEN, and by truncating it you made it a pipe.
That strikes me as bizarre but if that's the specification, then OK. Is the "input/output error" also expected? Thanks. --glenn
|
| Fri Mar 13, 2009 23:40 |
|
 |
|
jpa
NTFS-3G Lead Developer
Joined: Tue Sep 04, 2007 17:22 Posts: 1013
|
 Re: "Input/output error" and corruption after truncation
Hi Glenn, Quote: Is the "input/output error" also expected? That is a consequence : fuse has been disturbed by a file becoming a pipe through a call which was not meant to do that. A similar reaction occurs when a file is turned into a symlink by creating a junction point. We cannot really blame fuse for that. Regards Jean-Pierre
|
| Sat Mar 14, 2009 09:13 |
|
 |
|
glenn.ammons
Joined: Fri Mar 13, 2009 21:19 Posts: 6
|
 Re: "Input/output error" and corruption after truncation
jpa wrote: Hi Glenn, Quote: Is the "input/output error" also expected? That is a consequence : fuse has been disturbed by a file becoming a pipe through a call which was not meant to do that. A similar reaction occurs when a file is turned into a symlink by creating a junction point. We cannot really blame fuse for that. Regards Jean-Pierre Hi Jean-Pierre, I changed my code to truncate not hidden, system files to length 1 instead of to length 0. The truncate() calls still return "input/output error" and now the files become sockets instead of pipes! Is this expected? Is there a summary somewhere of how NTFS attributes + file length interact? Thanks. --glenn
|
| Mon Mar 16, 2009 19:45 |
|
 |
|
jpa
NTFS-3G Lead Developer
Joined: Tue Sep 04, 2007 17:22 Posts: 1013
|
 Re: "Input/output error" and corruption after truncation
Hi Glenn, Quote: I changed my code to truncate not hidden, system files to length 1 instead of to length 0. The truncate() calls still return "input/output error" and now the files become sockets instead of pipes! Is this expected? Same reason. Basically you should not play with files having the system flag set (nor change the hidden flag when system is set). Maybe ntfs-3g should forbid such truncations altogether. These files mean Windows system files or Linux special files which should not be truncated.... If you really mean to do that, you would have to clear the system flags first. Regards Jean-Pierre
|
| Mon Mar 16, 2009 22:19 |
|
 |
|
szaka
Tuxera CTO
Joined: Tue Nov 21, 2006 23:15 Posts: 1645
|
 Re: "Input/output error" and corruption after truncation
Hi Glenn,
Jean-Pierre is absolutely right. This is how Microsoft (Interix, bought by Microsoft long ago) implemented (hacked into NTFS) full POSIX support.
Please explain what you're trying to do? What software do you use? Who is setting these attributes this way and for what reasons? Thank you.
Regards, Szaka
|
| Tue Mar 17, 2009 01:11 |
|
 |
|
glenn.ammons
Joined: Fri Mar 13, 2009 21:19 Posts: 6
|
 Re: "Input/output error" and corruption after truncation
szaka wrote: Hi Glenn,
Jean-Pierre is absolutely right. This is how Microsoft (Interix, bought by Microsoft long ago) implemented (hacked into NTFS) full POSIX support.
Please explain what you're trying to do? What software do you use? Who is setting these attributes this way and for what reasons? Thank you.
Regards, Szaka Hi Szaka, I am creating a small "backup" of the filesystem that preserves filenames and other attributes/metadata but drops the file contents, which I don't need. I do this by saving the access and modification times, truncating the files, restoring the access and modification times, and finally running "ntfsclone". It seems that truncating not hidden, system files to length 2 does the trick but, after reading the comments from you and Jean-Pierre, I might just play it safe and not touch these files at all. There aren't many of them and they aren't big. Regards. --glenn
|
| Tue Mar 17, 2009 05:33 |
|
 |
|
szaka
Tuxera CTO
Joined: Tue Nov 21, 2006 23:15 Posts: 1645
|
 Re: "Input/output error" and corruption after truncation
glenn.ammons wrote: I am creating a small "backup" of the filesystem that preserves filenames and other attributes/metadata but drops the file contents, which I don't need. I do this by saving the access and modification times, truncating the files, restoring the access and modification times, and finally running "ntfsclone". ntfsclone --metadata does this if the underlaying file system supports sparse files. Not wiping access and modification times is only a few line changes. glenn.ammons wrote: It seems that truncating not hidden, system files to length 2 does the trick Yes. Length 0 is pipe, length 1 is socket. You found all the two problematic cases by the first two tries. Interix symlinks, device and character special files have signatures and the others are native. Regards, Szaka
|
| Tue Mar 17, 2009 05:49 |
|
|
|
Page 1 of 1
|
[ 9 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
 |