5

On the same mount, the touch command sometimes doesn't work

Using different directories on the same mount, the touch command gives different results

**bob@syno ~ % ll -d /volume1/media ; ll -d /volume1/doorgeef
drwxr-xr-x 1 root root 296 2019-05-19 07:05 /volume1/media/
drwxr-xr-x 1 root root 828 2019-05-19 07:02 /volume1/doorgeef/
bob@syno ~ % sudo rm /volume1/media/afile; sudo rm /volume1/doorgeef/afile
bob@syno ~ % sudo touch /volume1/media/afile; sudo touch /volume1/doorgeef/afile
bob@syno ~ % ls -l /volume1/media/afile; ls -l /volume1/doorgeef/afile
-rw-r--r-- 1 root root 0 May 19 07:24 /volume1/media/afile
-rw-r--r-- 1 root root 0 May 19 07:24 /volume1/doorgeef/afile
bob@syno ~ % sudo touch -d "2016-11-23 08:00:00" /volume1/media/afile ; sudo touch -d "2016-11-23 08:00:00" /volume1/doorgeef/afile
bob@syno ~ % ls -l /volume1/media/afile; ls -l /volume1/doorgeef/afile
-rw-r--r-- 1 root root 0 May 19 07:24 /volume1/media/afile
-rw-r--r-- 1 root root 0 Nov 23  2016 /volume1/doorgeef/afile
bob@syno ~ %**

Last two line in the code: Why does /volume1/doorgeef/afile lists the changed date, but not /volume1/media/afile?

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
ambrox
  • 59
  • 2
  • what system is this for? – entpnerd May 19 '19 at 06:12
  • I would try it without `-d "2016-11-23 08:00:00"` and see if that works. I would also run `mount -v` –  May 19 '19 at 10:25
  • 2
    What type of filesystems are the two directories mounted on? – Kusalananda May 19 '19 at 16:07
  • mount: /dev/mapper/vg1000-lv on /volume1 type btrfs (rw,relatime,synoacl,nospace_cache,auto_reclaim_space,ordered_extent_throttle=200000,metadata_ratio=50), so the filesystem is btrfs. And as you can see the directories are in the same sybdrectory. To try 'touch' without -d would be useless for me, because I need to change modification time. – ambrox May 20 '19 at 06:57
  • What do you get from `mount | grep /volume1` ? –  May 05 '20 at 21:39

0 Answers0