Bugs item #959924, was opened at 2004-05-25 07:46
Message generated for change (Comment added) made by antona
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=113956&aid=959924&group_id=13956
Category: None
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Anton Altaparmakov (antona)
Summary: the write support of NTFS driver
Initial Comment:
In the document of linux ntfs, I learned that "The only
supported write operation is overwriting existing files,
without changing the file length." So I made some
experiments to test this characteristic, but encountered
some problems.
I installed two operating system on my computer, one
is redhat linux, the other is Windows server 2003.
The kernel is linux 2.6.6, and the output of
"dmesg | grep -i ntfs" are:
NTFS driver 2.1.8 [Flags: R/W DEBUG].
NTFS volume version 3.1.
Firstly, I made the following experiment:
(1) Under the Windows 2003, I creat a simple text
file "1.txt", it only consists of one line of characters,
and the size of the file is 21 bytes;
(2) I reboot the system and switch to the linux, and
then mount the corresponding ntfs partition:
mount /dev/hda6 /mnt/ntfs
this command was completed successfully because when
I typed "mount", I saw:
....
/dev/hda6 on /mnt/ntfs type ntfs (rw)
(3)Then I use the vi editor to open the "1.txt" file and
try to replace one of its character by another
character, which means the content of the file is going
to change while the size of the file remains the same.
(4) I tried to save the modification and quit, but failed,
the error message is:
"1.txt" NTFS-fs error (device hda6): ntfs_setattr():
Changes in i_size are not supported yet. Sorry.
But I don't think I have changed the file length, so I
am wondering why this experiment failed. Did I do
something wrong?
Then I remembered that in the document of linux ntfs,
I read "Note only non-resident files can be written to,
so you may find that some very small files (<500 bytes
or so) cannot be written to. "
So I made the second experiment, and created a bigger
file "2.txt", whose length is 12, 324 bytes, and repeated
the above steps, but the result is the same.
Can you tell me why?
Thanks a lot!
Weijun Chen
----------------------------------------------------------------------
>Comment By: Anton Altaparmakov (antona)
Date: 2004-05-25 09:29
Message:
Logged In: YES
user_id=42205
Hi,
The problem you are seeing is because you used a text editor
to write to the file. What these programs do is to truncate
the file to zero size and then write it from scratch and
NTFS doesn't support the truncate to zero size operation so
this fails. You need to use a disk editor like hexedit or
dd or write your own program so that your file size is
really unaffected.
The second problem is that small files will indeed not be
written out to disk but the write will actually work, it
will just never hit the disk. The NTFS driver will emit a
warning message telling you this.
Best regards,
Anton
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=113956&aid=959924&group_id=13956
|