Hi Yura,
I am afraid your code for file/directory creation is broken. After
accessing volume with ntfsmount and creating some files in the root
directory running chkdsk I get:
[quote]
> chkdsk e: /f /x
The type of the file system is NTFS.
CHKDSK is verifying files (stage 1 of 3)...
File verification completed.
CHKDSK is verifying indexes (stage 2 of 3)...
Sorting index $I30 in file 5.
Index verification completed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
Security descriptor verification completed.
CHKDSK is verifying Usn Journal...
Usn Journal verification completed.
Correcting errors in the Volume Bitmap.
Windows has made corrections to the file system.
1140583 KB total disk space.
677976 KB in 34751 files.
12784 KB in 1890 indexes.
0 KB in bad sectors.
42591 KB in use by the system.
4096 KB occupied by the log file.
407232 KB available on disk.
2048 bytes in each allocation unit.
570291 total allocation units on disk.
203616 allocation units available on disk.
[/quote]
So the directory index that I modified was sorted incorrectly! That is
a very serious problem...
Also there seems to be a bug: "Correcting errors in the Volume Bitmap."
I wonder what that is going on about...
I suspect the problem with the index sorting is related to the bugs I
described in collation, i.e. the NTFS_COLLATION_ERROR stuff I wrote
about a few days ago as I predicted it would cause wrong collation and
it appears it does. To reproduce the bug create identical filenames
with only one character difference. E.g. this is what I have (after
chkdsk, the files I created are marked with a *):
aia21@imp:/usr/src/ntfsprogs/ntfsprogs> ./ntfsls -d /dev/hda9
Cygwin
Really_we|ird file.txt *
RECYCLER
resident_compressed.txt
resident_compressed2.txt
resident_encrypted.txt
resident_encrypted2.txt
short.txt
System Volume Information
tEst *
teSt *
test *
windbg-symbols
xpsp2-symbols
yura.pfx
yura2.pfx
zerofile.aes.enc.txt
zerofile.des.enc.txt
zerofile.desx.enc.txt
zerofile.txt
aaaafile.aes.enc.txt
aaaafile.des.enc.txt
aaaafile.desx.enc.txt
aaaafile.txt
chkdsk_errors.txt
CygwinPackages
long file name.txt hello
myefscert.pfx
myefscert_dec.pfx
really we * (this one also has a named stream "irdname")
really we!ird*name *
really we!irdname *
really we"irdname *
really we<irdname *
really we>irdname *
really we?irdname *
really weird*name *
really we\irdname *
Really_we\\ird file.txt *
Running chkdsk again to see what the "normal" output looks like:
>chkdsk e: /f /x
The type of the file system is NTFS.
CHKDSK is verifying files (stage 1 of 3)...
File verification completed.
CHKDSK is verifying indexes (stage 2 of 3)...
Index verification completed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
Security descriptor verification completed.
CHKDSK is verifying Usn Journal...
Usn Journal verification completed.
Windows has checked the file system and found no problems.
1140583 KB total disk space.
677976 KB in 34751 files.
12764 KB in 1890 indexes.
0 KB in bad sectors.
42611 KB in use by the system.
4096 KB occupied by the log file.
407232 KB available on disk.
2048 bytes in each allocation unit.
570291 total allocation units on disk.
203616 allocation units available on disk.
I am afraid I don't have any further info as I did not take a snapshot
of the volume before running chkdsk. )-:
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|