[CentOS] [rsync -avz] total size/disk usage difference between source and destination

Les Mikesell lesmikesell at gmail.com
Mon Nov 3 05:12:02 UTC 2008


John R Pierce wrote:
> Sven wrote:
>> Hi folks
>>
>> We migrated storage from local disk to SAN with:
>>
>> # rsync -avz /mnt/lvol00045/* /lvol00045
>>
>> Why there is a difference in size? How to explain this? Do we have
>> inconsistency? What we did wrong?
>>
>> [...]
>> /dev/mapper/vg01-lvol00045_old
>>                       10321208   3930336   6286016  39% /mnt/lvol00045
>> [...]
>> /dev/mapper/vg01-lvol00045
>>                       10321208   3163852   6633068  33% /lvol00045
>>   
> 
> 
> did rsync copy .* hidden files ?
> 
> do the two file systems have the same block size?

Rsync would copy hidden files when recursing as a side effect of the -a 
option.  However, the shell is going to expand that '*' before rsync 
sees the command line and miss any hidden files in the top level 
directory.  I'd probably have done:
cd /mnt/lvo100045
rsync -avH . /lvo00045
instead.  That gives rsync a directory as a starting point without 
having to remember the quirks of whether it will or won't create a 
subdirectory of that name on the target.  It also doesn't make sense to 
use -z for a local file copy and you might need -H if you have 
hardlinked files on the filesystem.

-- 
   Les Mikesell
    lesmikesell at gmail.com


More information about the CentOS mailing list