2

i cant change the access time of any file i create. i tried the touch -a, touch -ad, touch -t commands, but the access time in the stat utility stays the same. Can you please help me to modify the access time of the file, and the change time [if possible]. Thank You.

5
  • 1
    Sometimes changes to the filesystem are not written to physical media immediately. Try forcing the update by issuing sync through the terminal before using stat
    – hmayag
    May 28, 2014 at 6:48
  • 1
    What is the file you are trying to change, what is the location?
    – jobin
    May 28, 2014 at 6:49
  • 1
    To increase performance, atime is often disabled, check grep atime /etc/fstab. touch changes mtime, so it should work, what exact command are you running?
    – bain
    May 28, 2014 at 12:04
  • What is the underlying FS ? Are you using any lvm / fs snapshots ?
    – askb
    May 29, 2014 at 4:08
  • @hmayag Buffering on top of the physical media is irrelevant here: the kernel still sees changes in the cache even if they haven't been written to disk.
    – poolie
    Jun 2, 2014 at 4:17

1 Answer 1

1

Ubuntu, depending when/how you installed it, uses relatime or noatime mount options by default - this means that tracking of access times is basically disabled.

You can change it by removing that option from /etc/fstab and rebooting. Or, for instance

sudo mount -o remount,atime /home

on the relevant filesystem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .