Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a problem with transfer files between two Linux servers in the same network. On source server I have directory with 40055 small files, directory size is 34 GB. I tried to transfer those files with rsync command:

rsync -ah --progress --inplace /dir/dir_with_files user@server:/dir/destination_dir

After transfer, on destination server I have directory with size 108 GB not 34 GB

Blocks on partitions are the same.

I did the same thing with scp but the problem is the same.

share|improve this question
3  
Any sparse files ? –  Iain Feb 15 at 11:47
    
omg, I forgot that it may be sparse file. Thanks –  user209482 Feb 15 at 12:07

1 Answer 1

up vote 2 down vote accepted

For a complete retention of everything, try:

rsync --archive --hard-links --sparse-files --acls --xattrs source dest

Then to verify correctness, you can do something like (assuming no spaces in your file names): for file in *; do md5sum $file >> /tmp/sums.txt; done and then diff sums.txt on both servers. The md5summing is going to take a while, though.

If you do have spaces in your file names, construct something with find and/or xargs

BTW, what does du --bytes -hs say? That way, you rule out block size.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.