Register FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Sat May 25, 2013 19:51



Post new topic Reply to topic  [ 9 posts ] 
Preserve Create time on NTFS 
Author Message

Joined: Thu Jan 28, 2010 17:17
Posts: 6
Post Preserve Create time on NTFS
I need to preserve the Create time of a file when is been copied from Source NTFS to Destination NTFS partitions via a linux system.


Please help me in doing......


Thu Jan 28, 2010 17:22
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1012
Post Re: Preserve Create time on NTFS
Hi,

Quote:
I need to preserve the Create time of a file when is been copied from Source NTFS to Destination NTFS partitions via a linux system.
Please help me in doing......

Please see http://www.tuxera.com/community/ntfs-3g ... #filetimes

However there is a small bug in stable versions, you can use the latest advanced version from http://www.tuxera.com/community/ntfs-3g-advanced/ or wait till the fix makes through to the stable version.

Regards

Jean-Pierre


Thu Jan 28, 2010 17:58
Profile

Joined: Thu Jan 28, 2010 17:17
Posts: 6
Post Re: Preserve Create time on NTFS
Hi Jean-Pierre,

I have installed the latest version ntfs-3g and mounted the ntfs partition with below command.

ntfsmount -o streams_interface=xattr,force /dev/sdb1 /root/mnt

Then, I am trying to get times of a file on target mount point. For that, using below command

getfattr -h -n system.ntfs_dos_name mnt/usplash-theme-ubuntu.c
Results is "mnt/usplash-theme-ubuntu.c: system.ntfs_dos_name: No such attribute"

Please guide me to get and set filetimes of a file on ntfs partition.

Thanks in advance


Regards
Rajesh


Thu Jan 28, 2010 18:38
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1012
Post Re: Preserve Create time on NTFS
Hi,

Quote:
Then, I am trying to get times of a file on target mount point. For that, using below command
getfattr -h -n system.ntfs_dos_name mnt/usplash-theme-ubuntu.c
Results is "mnt/usplash-theme-ubuntu.c: system.ntfs_dos_name: No such attribute"

If you want to get times, why are you querying the dos name ? Apparently this file has no dos name (it was probably not written by Windows).

To get the timestamps, do
Code:
getfattr -h -e hex -n system.ntfs_times mnt/usplash-theme-ubuntu.c


Regards

Jean-Pierre


Thu Jan 28, 2010 20:32
Profile

Joined: Thu Jan 28, 2010 20:00
Posts: 2
Post Re: Preserve Create time on NTFS
I even tried to get timestamp of a file but it returns me array. Is there is any way to get all four attribute.

root@ubuntu:/# getfattr -h -e hex -n system.ntfs_times /mnt/dsdata/lan.log1
getfattr: Removing leading '/' from absolute path names
# file: mnt/dsdata/lan.log1
system.ntfs_times=0x007e04de73a0ca01807cac1b6672ca0100c0750ac795ca01007e04de73a0ca01


The mail requirement is to set changetime


Thu Jan 28, 2010 20:42
Profile

Joined: Thu Jan 28, 2010 20:00
Posts: 2
Post Re: Preserve Create time on NTFS
jpa wrote:
Hi,

Quote:
Then, I am trying to get times of a file on target mount point. For that, using below command
getfattr -h -n system.ntfs_dos_name mnt/usplash-theme-ubuntu.c
Results is "mnt/usplash-theme-ubuntu.c: system.ntfs_dos_name: No such attribute"

If you want to get times, why are you querying the dos name ? Apparently this file has no dos name (it was probably not written by Windows).

To get the timestamps, do
Code:
getfattr -h -e hex -n system.ntfs_times mnt/usplash-theme-ubuntu.c


Regards

Jean-Pierre


Thu Jan 28, 2010 21:49
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1012
Post Re: Preserve Create time on NTFS
Hi,

Quote:
I even tried to get timestamp of a file but it returns me array. Is there is any way to get all four attribute.

Well, you got all four timestamps....

Quote:
The mail requirement is to set changetime

Well, you just take the first eight bytes.

For instance :
Code:
CREATIME=`getfattr -h -e hex -n system.ntfs_times <source> | \
       grep '=' | sed -e 's/^.*=\(0x................\).*$/\1/'`
setfattr -h -v $CREATIME -n system.ntfs_times <target>

Regards

Jean-Pierre


Thu Jan 28, 2010 23:27
Profile

Joined: Thu Jan 28, 2010 17:17
Posts: 6
Post Re: Preserve Create time on NTFS
Things were working for me 8)

When ever I mount in windows, access time getting changed to a time of first visit(i.e, time of first accessing of file )

Regards,

Rajesh


Fri Jan 29, 2010 11:46
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1012
Post Re: Preserve Create time on NTFS
Hi,

Quote:
When ever I mount in windows, access time getting changed to a time of first visit(i.e, time of first accessing of file )

I told you previously :
Quote:
However there is a small bug in stable versions, you can use the latest advanced version from http://www.tuxera.com/community/ntfs-3g-advanced/ or wait till the fix makes through to the stable version.


Regards

Jean-Pierre


Fri Jan 29, 2010 13:01
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No registered users and 4 guests


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.