From: Thorsten O. <ad...@th...> - 2017-11-11 10:51:40
|
On Samstag, 11. November 2017 11:02:54 CET Thorsten Otto wrote: > I think i have to find out what really gets written to the disk there Ok, did that now. Created a plain FAT image (with mkdosfs), and mounted that with -t msdos to /mnt. Result: $ touch -d "2017-07-15 13:00:00" /mnt/bla $ ls -l --full-time /mnt/bla -rwxr-xr-x 1 root root 0 2017-07-15 13:00:00.000000000 +0200 /mnt/bla $ touch -d "2017-11-05 13:00:00" /mnt/bla $ ls -l --full-time /mnt/bla -rwxr-xr-x 1 root root 0 2017-11-05 13:00:00.000000000 +0100 /mnt/bla (+0200 was the daylight saving time in effect in July here, +0100 is the current timezone offset). On disk, i get: 00005800: 42 4C 41 20 20 20 20 20 20 20 20 20 00 00 00 00 "BLA ...." 00005810: 00 00 00 00 00 00 00 60 EF 4A 00 00 00 00 00 00 ".......`.J......" for the first, which is 2017-07-15 12:00:00 when i convert the stamp without applying any offset, and 00005800: 42 4C 41 20 20 20 20 20 20 20 20 20 00 00 00 00 "BLA ...." 00005810: 00 00 00 00 00 00 00 68 65 4B 00 00 00 00 00 00 ".......heK......" for the 2nd, which is 2017-11-05 13:00:00. So it seems linux has the same problems, the stamp for the first file (on disk) is off by 1 hour. What happens is that: - touch converts the time i specified to an UTC time, subtracting the offset of +0200 that was in effect at that time. - the kernel adds the current time offset before writing the stamp, because for FAT a local time should be stored. Not very pleasing. That means, if i wait half a year, and daylight savings time is in effect again, ls -l will suddenly report a different time. |