I copied some directories on one removable drive to another removable one using rsync. The command used was:

rsync -avPS <source> <destination>

rsync doesn't report any errors.

After syncing I used diff on some random directories to check for differences or errors. The synced files are apparently identical (checked with a simple ls -lh), nevertheless diff reports that they differ.

diff <source_dir> <destination_dir>

The files are all RAW photo files and their sidecar files (text files).

What could be the reason for the file differences?


The filesystems are (partial output from fdisk -l):

  • SRC:

/dev/sdb1 2048 1953521663 976759808 7 HPFS/NTFS/exFAT

  • DST:

/dev/sdd1 63 1953520064 976760001 7 HPFS/NTFS/exFAT

This is the output of ls -l:

  • SRC:

-rw------- 1 twan twan 177556828 Apr 19 12:38 20160403101701-07.tiff

  • DST:

-rw------- 1 twan twan 177556828 Apr 19 12:38 20160403101701-07.tiff

Here is the output of diff for this specific file:

Binary files /media/twan/GrafxMedia/photos/hdr/20160403101701-07.tiff and ./20160403101701-07.tiff differ

  • 1
    Clarifications please. 1. Removable media - you did unmount it before unplugging? 2. Please provide examples of the differences reported by diff and the corresponding sameness suggested by ls -lh. – roaima Jun 2 '16 at 10:15
  • what type of filesystems are the source and destination? ext4? xfs? FAT? NTFS? – cas Jun 2 '16 at 10:29
  • 1
    Run cmp -l /media/twan/GrafxMedia/photos/hdr/20160403101701-07.tiff and ./20160403101701-07.tiff to get a list of differing bytes. Did the file already exist on the destination before you ran rsync? Did you ever unplug that disk before the operating system had reported that it had finished unmounting? – Gilles Jun 3 '16 at 21:13
  • This does rather look like a disk that was unplugged before being unmounted – roaima Jun 3 '16 at 21:23
  • Can I somehow check if the disk was unplugged before unmounting? This is a home PC, family members have access to it.. At least then I know what the cause could be. No harm done, I still have all files. – twan163 Jun 4 '16 at 6:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.