[SOLVED] rsync creates destination directories smaller than the source directories. Why?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634
Rep:
rsync creates destination directories smaller than the source directories. Why?
I built a new PC. Now I'm moving over my data from the old PC's /home/{me}, in particular my pictures. I noticed a slight reduction in the size of the destination directories as compared to the source directories (e.g. 999.678.662 vs. 999.709.360 bytes). Both file systems are ext4. The files of the pictures have the same size in source and destination. What happens here?
I built a new PC. Now I'm moving over my data from the old PC's /home/{me}, in particular my pictures. I noticed a slight reduction in the size of the destination directories as compared to the source directories (e.g. 999.678.662 vs. 999.709.360 bytes). Both file systems are ext4. The files of the pictures have the same size in source and destination. What happens here?
#1 what are you using to report the size of the directories? How are you getting the sizes of the files?
#2 What are the file system characteristics on BOTH sides, do they match?
#3 Is this observation only about the image files, or are text and other files also affected?
Probably some of the directory files themselves are using less space. An ext4 directory file grows as more files are added, but does not shrink when files are removed. A directory which once contained a large number of files, but now contains fewer, remains at its larger size. When you copy that directory and its contents, the directory at the destination will only be large enough (rounded up to a block size) to contain the current number of file names with their inode numbers and types.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,634
Original Poster
Rep:
Quote:
Originally Posted by wpeckham
#1 what are you using to report the size of the directories? How are you getting the sizes of the files?
#2 What are the file system characteristics on BOTH sides, do they match?
#3 Is this observation only about the image files, or are text and other files also affected?
1# I used dolphin on each machine and via SFTP from the new one. For single files I used also "ls".
2# Both are ext4, they should match exactly being created by the SUSE install process.
3# There are only images there.
Thanks for your input .
@rknichols Thank you. That explains it and I'm relieved . Marking this thread as solved.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.