I copied my entire photo library from a Windows Samba share mounted in fstab
, into a local directory on my Ubuntu Linux machine using the terminal.
cp /sambashare/photos /localdisk/photos
Sadly this reset the date modified field to the current date on all of my photos. I tested this again and copied some photos from the Windows Samba share over to the exact same Linux machine with Windows file explorer (I simply created a second samba share on the Linux system.) And I noticed that this method preserved all of the date modified metadata.
Therefore the issue must be that the Linux command cp
does not even try to retain date modified data when copying files from Samba shares. Unfortunately, my original photo library is not available so now all my photos have missing date modified data.
My first question is, is there any way to get this data back? Perhaps it's still located in the file but Linux is just not displaying it properly?
My second question or future reference is, is there any way to make the cp command retain this metadata in these scenarios?
Thanks