I have a source directory on a machine with a bunch of files, all with the same permissions, that I want to copy to another directory, that is mounted via SMB.
[tmark@dexter JR09141045 roche_454_transfer]$ ls -l /source_dir
total 71348
-rwxrwxrwx 1 adminrig lifelabs 19768377 Mar 25 23:29 1.TCA.454Reads.fna
-rwxrwxrwx 1 adminrig lifelabs 53093396 Mar 25 23:29 1.TCA.454Reads.qual
-rwxrwxrwx 1 adminrig lifelabs 1035 Mar 25 23:29 454AllControlMetrics.csv
-rwxrwxrwx 1 adminrig lifelabs 2657 Mar 25 23:29 454AllControlMetrics.txt
-rwxrwxrwx 1 adminrig lifelabs 4607 Mar 25 23:29 454BaseCallerMetrics.csv
-rwxrwxrwx 1 adminrig lifelabs 14518 Mar 25 23:29 454BaseCallerMetrics.txt
-rwxrwxrwx 1 adminrig lifelabs 351 Mar 25 23:23 454DataProcessingDir.xml
-rwxrwxrwx 1 adminrig lifelabs 702 Mar 25 23:29 454QualityFilterMetrics.csv
-rwxrwxrwx 1 adminrig lifelabs 1609 Mar 25 23:29 454QualityFilterMetrics.txt
-rwxrwxrwx 1 adminrig lifelabs 13496 Mar 25 23:29 454RuntimeMetricsAll.csv
-rwxrwxrwx 1 adminrig lifelabs 26967 Mar 25 23:29 454RuntimeMetricsAll.txt
-rwxrwxrwx 1 adminrig lifelabs 1675 Mar 25 14:48 dataRunParams.xml
-rwxrwxrwx 1 adminrig lifelabs 7134 Mar 25 23:29 gsRunProcessor.log
The target directory is mounted via SMB and I'm trying to copy the set of files all at once.
[tmark@dexter JR09141045 target_dir]$ cd /target_dir
[tmark@dexter JR09141045 target_dir]$ cp -p /source_dir/* ./
cp: preserving times for `./454AllControlMetrics.csv': Operation not permitted
cp: preserving times for `./454AllControlMetrics.txt': Operation not permitted
cp: preserving times for `./454BaseCallerMetrics.csv': Operation not permitted
cp: preserving times for `./454BaseCallerMetrics.txt': Operation not permitted
cp: preserving times for `./454DataProcessingDir.xml': Operation not permitted
cp: preserving times for `./454QualityFilterMetrics.csv': Operation not permitted
cp: preserving times for `./454QualityFilterMetrics.txt': Operation not permitted
cp: preserving times for `./454RuntimeMetricsAll.csv': Operation not permitted
cp: preserving times for `./454RuntimeMetricsAll.txt': Operation not permitted
cp: preserving times for `./dataRunParams.xml': Operation not permitted
cp: preserving times for `./gsRunProcessor.log': Operation not permitted
[tmark@dexter JR09141045 target_dir]$ ls -l
total 71264
-rwxrwxrwx 1 tmark 1008 19768377 Mar 25 23:29 1.TCA.454Reads.fna
-rwxrwxrwx 1 tmark 1008 53093396 Mar 25 23:29 1.TCA.454Reads.qual
-rwxr-xr-x 1 tmark 1008 1035 Apr 1 2015 454AllControlMetrics.csv
-rwxr-xr-x 1 tmark 1008 2657 Apr 1 2015 454AllControlMetrics.txt
-rwxr-xr-x 1 tmark 1008 4607 Apr 1 2015 454BaseCallerMetrics.csv
-rwxr-xr-x 1 tmark 1008 14518 Apr 1 2015 454BaseCallerMetrics.txt
-rwxr-xr-x 1 tmark 1008 351 Apr 1 2015 454DataProcessingDir.xml
-rwxr-xr-x 1 tmark 1008 702 Apr 1 2015 454QualityFilterMetrics.csv
-rwxr-xr-x 1 tmark 1008 1609 Apr 1 2015 454QualityFilterMetrics.txt
-rwxr-xr-x 1 tmark 1008 13496 Apr 1 2015 454RuntimeMetricsAll.csv
-rwxr-xr-x 1 tmark 1008 26967 Apr 1 2015 454RuntimeMetricsAll.txt
-rwxr-xr-x 1 tmark 1008 1675 Apr 1 2015 dataRunParams.xml
-rwxr-xr-x 1 tmark 1008 7134 Apr 1 2015 gsRunProcessor.log
Note that the times and permissions on the first two files are the same as in the source directory, but differ for the remaining files.
So, it seems that I can copy some files and preserve their permissions and times, but not with other files, even though all the source files come from the same place and have the same permissions and (more or less) times, and I'm copying them all to the same directory at the same time - and hence with the same umask, etc.
So, why can I preserve the times for some, but not all files ?
I'd be happy to provide more details (umask, Linux version, smb.conf, etc etc.) except I can't understand how any of those details could explain what I'm seeing - as they ought to be constant here.