Samba - Windows 'Date accessed' vanishes

I updated from OpenSuse 15.2 to 15.3 recently, and since then I have files on my samba server that lose their Windows ‘Date accessed’ property. This makes them inaccessible to some Windows programs until I restore the ‘Date accessed’ with a utility called ‘Attribute Cahnger 10’. Help please.

My smb.conf

Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        interfaces = 10.0.0.139/24
        logon drive = P:
        logon home = \\%L\%U\.9xprofile
        logon path = \\%L\profiles\.msprofile
        map to guest = Bad User
        netbios name = SERVER
        preferred master = No
        printcap name = cups
        security = USER
        server string = ""
        wins server = 10.0.0.1
        workgroup = HUTTON
        idmap config * : backend = tdb
        cups options = raw


[homes]
        browseable = No
        comment = Home Directories
        inherit acls = Yes
        read only = No
        valid users = %S %D%w%S


[profiles]
        comment = Network Profiles Service
        create mask = 0600
        directory mask = 0700
        path = %H
        read only = No


[users]
        comment = All users
        inherit acls = Yes
        path = /home
        read only = No
        veto files = /aquota.user/groups/shares/


[groups]
        comment = All groups
        inherit acls = Yes
        path = /home/groups
        read only = No


[printers]
        browseable = No
        comment = All Printers
        create mask = 0600
        path = /var/tmp
        printable = Yes


[print$]
        comment = Printer Drivers
        create mask = 0664
        directory mask = 0775
        force group = ntadmin
        path = /var/lib/samba/drivers
        write list = @ntadmin root


[drbd]
        comment = ha-share
        create mask = 02775
        directory mask = 02775
        path = /mnt/drbd
        read only = No

Hi TimR. This thread caught my attention…I’m not able to replicate this (simple standalone samba server and Windows 10 client). I’m currently using openSUSE Leap 15.3 with samba version 4.15.4. Are you using same Windows version? Can you share an example screenshot of the Windows file manager showing this issue?

Hopefully others can advise further. I’ll stay tuned. :slight_smile:

When I access my Leap 15.3 server with samba version 4.15.4

I can access my files properties no problem:

https://paste.opensuse.org/95610971

Thanks deano_ferrari and JulinaB for your responses. I was hoping that there was some entry into smb.conf that I’d overlooked, but it seems not. I’ll give steps to reproduce my issue.

My sambe server has my digital photography images on it in NEF, DNG and JPG format. It also has MS Office documents, PDFs and music files. I have only noticed the problem with image files, but they are what I edit the most. When edits are made to a raw image file, the ‘Date accessed’ property vanishes and two programs that I use extensively can’t access the file, until I restore a ‘Date accessed’ with ‘Attribute Changer 10’. The two programs with the issues are exiftool and irfanview.

Here are some screenshots of missing ‘Date accessed’
screenshot no ‘Date accessed’ eg 1 https://1drv.ms/u/s!Aun5Go97_mojgr0OXDAJoynTQMOjDQ?e=jWsKlo
screenshot no ‘Date accessed’ eg 2 https://1drv.ms/u/s!Aun5Go97_mojgr0P2kDpYePd64OV2g?e=zcnWPq

Here is a link to a DNG image file. https://1drv.ms/u/s!Aun5Go97_mojgr0THWd8WyXOqlhLww?e=dqtYaB
If I edit the DNG file with Adobe Camera Raw (ACR) through Abobe Bridge, or I edit the image metadata with exiftool the ‘Date Accessed’ vanishes. Exiftool is open source, and probably the easiest way to try to reproduce the problem if you don’t have Adobe products installed.

-Download the DNG and store on a samba network drive
-The rest of the steps are all through Windows
-check to see if ‘Date Accessed’ is present, it isn’t on my files when I download them from my phone.
-Download ‘Attribute Changer 10’ https://www.petges.lu/pubfiles/ac-10_10a.exe, and install
-restore ‘Date Accessed’ (via right click menu item on image) ‘Change Attributes/Used Saved’. Attribute Changer 10 > File Properties tab > tick ‘Modify date and time stamps’, deselect Created and Modified, set Accessed to ‘Create Value from File tab’ > OK
-Download exiftool https://exiftool.org/exiftool-12.40.zip, unzip it to folder

C:\utilities\exiftool\

-add a shortcut to your desktop with the following command.

C:\utilities\exiftool\exiftool.exe -k -v -xmp:rating=3 -xmp:ratingpercent=50 -exif:rating=3 -exif:ratingpercent=50 -overwrite_original

-drag the dng image onto the shortcut, this will rate the image as ‘3 stars’
-‘Date Accessed’ vanishes
-try to drag the the now rated DNG again onto the exiftool shortcut, get ‘Error: File not found’
NB if the -P flag (preserve original date/time) is added to the exiftool command line, as below, the issue doesn’t occur

C:\utilities\exiftool\exiftool.exe -k -v -P -xmp:rating=3  -xmp:ratingpercent=50 -exif:rating=3 -exif:ratingpercent=50  -overwrite_original

-irfanview (image viewer program) https://www.irfanview.com/main_download_engl.htm will also object with ‘Not a valid RAW file’ when trying to view the file.
-similar issue occurs with NEF image files.

Thanks,
Tim.

The only thing I can think that may make a difference is the underlying file system. Mine is ext4.

Same here.

FWIW, I edited the file with Windows Paint 3D application, then saved. (Samba isn’t aware of the client application.)

I got the following as expected…

https://paste.opensuse.org/images/16123867.PNG

Thanks again deano_ferrari and JulinaB for your responses.

My underlying file system is also ext4. I think I remember reading that there are mount options that influence filetimes, but I couldn’t find the reference again.

@deano_ferrari I don’t think you have downloaded the DNG file, just got a JPG version of it. From my OneDrive link, you’ll need to click ‘Download’ from options above the image. The file is 11.8 MB in size. I don’t think you’ll be able to edit it with Windows Paint 3D directly, as I don’t think that application can manipulate RAW image files, though it may make a JPG copy that it can use.

If you can be bothered persisting and do manage to download the DNG file, you can use the exiftool command directly from a command prompt window, but setting up the shortcut makes for a lot less typing.

I do realise that samba is not aware of the application being used, the issue I believe is how those various applications commit saves of the file. The give away I think, is that changing the preserve filetime (-P) option in exiftool changes whether the ‘Date accessed’ gets removed or not.

I have done some further testing and confirmed from the linux side ‘atime’ gets removed. See the following for before and after I run the exiftool command causing the issue.

tim@server2:/mnt/drbd/data/pictures/2022/2022-01-01 Cape Conran> ls -l --time=atime 2022-01-05\ 135608\ -\ Copy.dng
-rwxrw-r-- 1 tim users 12446886 Feb 26 02:22 2022-01-05 135608 - Copy.dng
tim@server2:/mnt/drbd/data/pictures/2022/2022-01-01 Cape Conran> ls -l --time=atime 2022-01-05\ 135608\ -\ Copy.dng
-rwxrw-r-- 1 tim users 12446886 Sep 14  30828 2022-01-05 135608 - Copy.dng

In my research in to this problem, I came up with suggestions to use the following in smb.conf, but it didn’t seem to make a difference.

dos attributes = yes

Thank you for you efforts, I realise that there is a bit of setup even to test this issue.

I’ve downloaded the .dng file and edited (sbribbled over it) with ‘Snip and Sketch’ Windows app, saved and checked the file with Windows File > Properties. It behaves consistently as expected…
https://susepaste.org/images/33503184.PNG

If you can be bothered persisting and do manage to download the DNG file, you can use the exiftool command directly from a command prompt window, but setting up the shortcut makes for a lot less typing.

I do realise that samba is not aware of the application being used, the issue I believe is how those various applications commit saves of the file. The give away I think, is that changing the preserve filetime (-P) option in exiftool changes whether the ‘Date accessed’ gets removed or not.

This may be the crux of it. It is not a samba issue, but apparently down to your particular Windows application behavior.

Thanks again deano_ferrari for having a look.

If it was just Exiftool that caused the issue, I’d be happy to work around the issue with another application, but it is not.

After a file is edited by Exiftool, Adobe Camera Raw, DigiKam, and Nikon’s Capture NX2 (though not consistently with Capture NX2) the ‘Date accessed’ vanishes.

Some Windows applications don’t seem to care about this, they will manipulate the file regardless, but others do. IrfanView and Exiftool seem to need ‘Date accessed’ to open the file. There will probably be others. The testing you have done with Paint 3D and Snip and Sketch doesn’t actually alter the DNG file. When you saved your Snip and Sketch scribble, it overwrote the DNG file with a PNG file incorrectly given a DNG suffix. Windows image handling codec just silently handles that. Can you try the exiftool test?

I’m not going to pursue this any further. If it is Windows application specific, then that is where you need to direct your attention. Not a samba issue.

Maybe consider discussing your exiftool issue in their forum…
https://exiftool.org/forum/

This may be of interest perhaps?
https://exiftool.org/forum/index.php?topic=12165.0

Another potentially illuminating thread…
https://exiftool.org/forum/index.php?topic=3167.0

Thanks for your assistance deano_ferrari.

I think I have solved the issue thanks to the hints from yourself and JulinaB to look at the underlying filesystem that samba is using.

Mine is ext4 and was mounted with option ‘relatime’, which I think is the default, I changed the mount to ‘strictatime’ and the problem has resolved. I can reliably reproduce the issue of ‘Date accessed’/‘atime’ disappearing by switching between mounting samba’s underlying filesystem with the two different atime options.

These options are explicitly given as performance/functionality trade offs, so this appears to be a configuration issue. But a tricky one, given that to influence samba’s behaviour, a change has to made outside of samba.

And just to leave a little more information for anyone else that might find this of interest. All the programs that triggered this issue, that is: Adobe Camera Raw, Exiftool, DigiKam, Irfanview and Capture NX2, manipulate or view the metadata contained within RAW image files. This is the place where the caption, rating, camera model, exposure, etc for the image is stored. My only guess as to why this issue has appeared is that the field of digital photography cares more about file timestamps (when was the image taken?, when last edited?), than other areas and hence RAW image software relies more heavily on ‘Date created’, ‘Date modified’ and ‘Date Accessed’ to work. As to what changed between OpenSuse Leap 15.2 and 15.3, I have no idea.

FWIW, I only suggested using Exiftool to reproduce the issue as it seemed the easiest to do on Windows systems that are not set up for RAW image photography.

Thanks for sharing your findings here. It may well be of help to others who come searching. :slight_smile:

Additional info:
https://www.howtogeek.com/517098/linux-file-timestamps-explained-atime-mtime-and-ctime/