Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have following setup:

  1. mountserver - debian linux
  2. fileserver1 - Windows 2008 R2 Storage server
  3. fileserver2 - Celerra NS20 exporting CIFS share
  4. workstation - windows 7 with mapped drive to share on fileserver2

What we are doing:

  • mounted share from fileserver1 on mountserver, e.g. /shared/fileserver1
  • mounted share from fileserver2 on mountserver, e.g. /shared/fileserver2
  • ran rsync on mountserver to sync data from fileserver1 to fileserver2.Used atime as parameter to sync data not older than X
  • after a while tried to delete data older that Y on /shared/fileserver2.

From what I see, linux stat command on mountserver returns following when quering file on /shared/fileserver2:

Linux file timestamp

At the same time when I open property for the same file using mapped drive connected to fileserver2,I see following for the same file:

Windows file timestamp

As you can see, Created date of 12 August shown in Windows Explorer is nowhere to be seen using stat command

Am I missing something here?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

Linux does not store the file creation time. So, you will not be able to view such information on a Linux machine.

Here is a link that shows the inode data structure. You can find:

time_t                       i_atime;
time_t                       i_mtime;
time_t                       i_ctime;

None of these is creation time.

share|improve this answer
    
Thank you.Do you know more details or link that describes it? –  Sergei Apr 24 '12 at 11:35
    
@Sergei: I don't have a reference for this now, but at least you can look at man ls and man stat. You will not find any mention for creation time, but you can find change time, last access time,etc.. –  Khaled Apr 24 '12 at 11:40
    
@Sergei: I provided a link. –  Khaled Apr 24 '12 at 11:49
    
I have asked because your answer is a bit vague.My understanding it is filesystem related.en.wikipedia.org/wiki/Ext4 for example says 'ext4 also adds support for date-created timestamps' –  Sergei Apr 24 '12 at 11:52

FIle creation time is not stored anywhere in linux partitions so stat is only displayin following :

atime (access time)
mtime (last modification time)
ctime (last status change)
share|improve this answer

Some newer Linux file systems are supporting information (within their inodes) about file creation time, such as JFS, ext4 or btrfs. But traditional Unix and Linux file system did not support it and so the whole tool chain is not aware of such feature yet.

So eventhough smbfs/cifs could have access to this information, there is no place yet to report this information in the stat structure:

struct stat {
  dev_t     st_dev;     /* ID of device containing file */
  ino_t     st_ino;     /* inode number */
  mode_t    st_mode;    /* protection */
  nlink_t   st_nlink;   /* number of hard links */
  uid_t     st_uid;     /* user ID of owner */
  gid_t     st_gid;     /* group ID of owner */
  dev_t     st_rdev;    /* device ID (if special file) */
  off_t     st_size;    /* total size, in bytes */
  blksize_t st_blksize; /* blocksize for file system I/O */
  blkcnt_t  st_blocks;  /* number of 512B blocks allocated */
  time_t    st_atime;   /* time of last access */
  time_t    st_mtime;   /* time of last modification */
  time_t    st_ctime;   /* time of last status change */
};
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.