-2

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?

1 Answer 1

1

Is this a FAT32 filesystem? According to Wikipedia, date resolution in FAT32 is 1 day for access date.

Your 2023-06-20 03:00:00.000000000 +0300 is midnight in UTC, but it seems FAT32 does not store any timezone information. So this is really just sole 2023-06-20 date with no timezone specified, interpreted as midnight in UTC, then translated to your timezone which apparently is +0300, hence these 03:00:00 and +0300 in the output of stat. The filesystem itself holds the date only.

To make it work as you expect, you need to use another type of filesystem. If it has to be a Windows-compatible filesystem then this answer may be helpful: Windows-compatible filesystems' file time resolutions.

1
  • it must be fat32 filesystem. there is a way to do this. someting in the mount command must change...
    – dshman
    Commented Jun 20, 2023 at 22:04

You must log in to answer this question.

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