LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   rsync and du sizes differ (https://www.linuxquestions.org/questions/linux-server-73/rsync-and-du-sizes-differ-948663/)

theace18 06-05-2012 12:18 PM

rsync and du sizes differ
 
Hey Everyone,

I am trying to rsync some things from my server to a backup server offsite. However when I run a du on the server and a du on the offsite backup server, their sizes are WAY different

Primary Server:

[root@mediaserver media]# du -chs
1.5G .
1.5G total


Backup Server:

[root@linux-backup media]# du -chs
15G .
15G total


Here is a sample of my rsync command that I am using:

rsync --stats --archive --delete --recursive /media/ root@10.10.10.73:/media/


Am I doing something wrong? Not sure the size on my backup server differs so much. Any help would be greatly appreciated. Thanks!

- Philippe

suicidaleggroll 06-05-2012 12:47 PM

What kind of files are you backing up? The typical answer is you have some hard links in your source, which are then being expanded in the copy. For example, you might have a 100MB file, and then three hard links to it. On the source machine it's just four links to the same 100MB, so total disk usage is 100MB, but a standard rsync call would copy over the four links as four separate 100MB files, using 400MB of disk space on the destination machine.

pan64 06-05-2012 12:53 PM

if you have sparse files you would need -S also: http://extrabright.com/blog/2007/06/...es-with-rsync/.
also there can be other files on the target, have you tried a deeper compare on the differences? Would be much better if you found a file or a single dir to compare.

theace18 06-05-2012 01:27 PM

Ah hard links! Forgot about those guys. Makes sense now. Thanks!


All times are GMT -5. The time now is 12:32 PM.