0

From a linux box, I recently mounted a Windows share using cifs.

The intend was to "locally" use rsync to backup my windows machine. The command line used to mount the Windows drive is something like:

mount \\192.168.1.74\share /cifs1 -t cifs -o noserverino,iocharset=utf8,ro 

Please also note that the drive attached to the linux box is formatted ntfs.

When doing a sample backup, rsync was always re-copying the directories (names), but not the files. After looking more closely at the "ls -lh " output at both ends, I noticed that on the linux side the size of the directory level is always 0:

TTT-Admin@1080-Router:/tmp/mnt/RT-1080/tmp# ls -lh
drwxrwxrwx    1 TTT-Admi root           0 Feb  8 12:14 DeltaCopy

but the size of the directory level on the cifs side was always different from 0:

TTT-Admin@1080-Router:/cifs1/temp/Rsync-Packages# ls -lh
drwxr-xr-x    1 TTT-Admi root        8.0K Feb  8 12:14 DeltaCopy

This difference explains why rsync was always recopying directories, but not recopying the folders(which was correct, folder sizes and time stamps being the same on both ends).

EDIT: the rsync command is:

> rsync -av /cifs1/Temp/Rsync-Packages/DeltaCopy /mnt/RT-1080/tmp/rsync
 -av /cifs1/Temp/Rsync-Packages/DeltaCopy /mnt/RT-1080/tmp/

Is a directory supposed to "have a size" or not ? What should I do to solve this discrepancy ?

user229044
  • 232,980
  • 40
  • 330
  • 338
huotg01
  • 25
  • 2

0 Answers0