Atime don't change in mounted drive

Issues related to applications and software problems and general support
Post Reply
dshman
Posts: 3
Joined: 2023/06/20 21:02:38

Atime don't change in mounted drive

Post by dshman » 2023/06/20 21:15:23

hi,
i have CentOS Stream 9.
when i mount a usb drive and create a file using touch command the Access time in stat command don't change and stays:
"Access: 2023-06-20 03:00:00.000000000 +0300"
it stays like this also when i use the command "cat file"

i try to mount with the following command:
mount -o strictatime,fmask=000 /dev/sdb1 /home/linux1/USB

this is the output of the mount command:
[root@localhost USB]# mount | grep "USB"
/dev/sdb1 on /home/linux1/USB type vfat (rw,fmask=0000,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

this is the output of stat command:
[root@localhost USB]# stat file
File: file
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 811h/2065d Inode: 180 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Context: system_u:object_r:dosfs_t:s0
Access: 2023-06-20 03:00:00.000000000 +0300
Modify: 2023-06-20 23:36:02.000000000 +0300
Change: 2023-06-20 23:36:02.140000000 +0300
Birth: -

there is something more that i have to change to make it work, i dont know what. someone can help?

User avatar
TrevorH
Site Admin
Posts: 33232
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Atime don't change in mounted drive

Post by TrevorH » 2023/06/20 22:35:45

there is something more that i have to change to make it work, i dont know what
Probably the filesystem type. I am not sure that vfat supports atime.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dshman
Posts: 3
Joined: 2023/06/20 21:02:38

Re: Atime don't change in mounted drive

Post by dshman » 2023/06/20 23:01:06

it must be fat32 filesystem
its something in the mounting options, that the reason for the output of the mount command.
in non mounted drive i have atime...

User avatar
TrevorH
Site Admin
Posts: 33232
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Atime don't change in mounted drive

Post by TrevorH » 2023/06/20 23:54:47

Google seemed to be telling me that atime was not supported on vfat. I can't be bothered to go and read the code to find out.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dshman
Posts: 3
Joined: 2023/06/20 21:02:38

Re: Atime don't change in mounted drive

Post by dshman » 2023/06/21 07:58:50

Thank you,
i changed the filesystem of the drive to ext4. all is fine now :D

Post Reply