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.
"df -h" says both partitions now have 110G used, but "du -s" reports 114808759 in the source directory and 115015088 in the destination directory. Something else I noticed was that despite the fact that they both have 110G used, the source directory's size is 114G with 3.9G free, which makes sense, but the destination directory has a size of 119G with only 2.4G available. Why is that?
Would using different filesystems cause these discrepencies? The source directory filesystem is reiser3 and the destination filesystem is ext3. Is the reason as simple as that, or are the two rsync'd directories not identical?
The filesystem does have an effect on the size of files on disk.
I believe the difference between the free space and (total - used space) is normal.
I've been wondering off and on for months, since I saw it on all 3 linux servers
we are running here, too.
I don't know for sure but I imagine it has to do with the drive's fragmentation.
I think baikonur answered kav's question (size differences between reiser4 and ext3) but brought up a new one:
Quote:
Originally Posted by baikonur
I believe the difference between the free space and (total - used space) is normal.
I've been wondering off and on for months, since I saw it on all 3 linux servers
we are running here, too.
I don't know for sure but I imagine it has to do with the drive's fragmentation.
Yes, this difference is normal because some blocks (e.g., 5%) are reserved for root.
Quote:
Originally Posted by man mkfs.ext3
-m reserved-blocks-percentage
Specify the percentage of the filesystem blocks reserved for the super-user. This
avoids fragmentation, and allows root-owned daemons, such as syslogd(8), to con‐
tinue to function correctly after non-privileged processes are prevented from
writing to the filesystem. The default percentage is 5%.
E.g., on one of my disks,
Code:
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/sda6 20158 5187 13948 28% /
Here 95% of 20158M = 19150M (available for normal users), and 5187M + 13948M = 19135M. Not exactly the same, but close -- 19G out of 20G are available for normal users, 1G is set aside for root.
Thanks, that answers one question. But does it mean that the exact same data takes up a different amount of space on 2 different file systems?
I think this might in fact be the case. $ du -s * reveals several empty directories that take up 0 on the ext3 partition. Those same directories take up 4 on the reiser partition. But would that really add up to the size difference that I have between the two of 114808759 and 115015088?
I think this might in fact be the case. $ du -s * reveals several empty directories that take up 0 on the ext3 partition. Those same directories take up 4 on the reiser partition
Interesting... now, to see if that has anything to do with rsync, you could create an empty directory on the ext3 partition. I think you'd get something with a size bigger than 0.
On my laptop, I get
('insgesamt' being german for 'total')
So that's two links on something which is 6 bytes big, right? That something being completely empty. Maybe you could post the ls -al results for both source and destination empty directory.
Hi Baikonur, I'm afraid we just added another "It depends". It looks like you benefit from some small file optimization, because it costs me not 6 bytes but 4K:
Code:
$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda7 19346964 6919992 11444200 38% /home
$ mkdir empty
$ ls -l empty
total 0
$ ls -la empty
total 8
drwxr-xr-x 2 brech dba 4096 Nov 13 13:39 ./
drwxr-xr-x 6 brech brech 4096 Nov 13 13:39 ../
$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda7 19346964 6919996 11444196 38% /home
$ rmdir empty
$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda7 19346964 6919992 11444200 38% /home
$ mount | grep /home
/dev/sda7 on /home type ext3 (rw)
This is on ubunutu. Grepping mount confirms it's ext3. BTW, 6 looks suspiciously like the string length of "empty\0". Do you care to mkdir some-much-longer-directory-name?
so that empty file is 0 bytes big... but creating it takes away 184 k-blocks, but creating a directory doesn't use up any blocks, even though it is 6 bytes.
Still six bytes (and no impact on df). I hope it frees those 184k again when you delete the empty file! (Or was there some other process creating another file). I think xfs is weirder than ext3. Then again, I'm used to the latter.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Umm, just my
1. The size of the Blocks should matter, since they (can) vary from file system to file system and from installation to installation.
2. The systems you compare are journalling systems which do their journalling differently (e.g. ext3 is using lists (of inodes) and XFS as well as Reiser B+trees (plus --partly-- lists). I certainly can't say what that does to the size...
3. Extra cent at no extra cost : Neither of you did sync their disk(s). That might matter as well...
I'll stop worrying about rsync not actually copying all my files.
To see if "all" files are there (same names), you could run ls -R in both /mnt/myhome/user and /mnt/backup, redirecting the output to temporary files, and diff the files. Use ls -lR to also compare mode, ownership, size and mtime.
If you want to check if the contents are exactly the same, [b]find . -type f | xargs md5sum > /tmp/f0[b] (and f1 from the other dir) and then diff, but that will take a LONG time because md5sum will have to read through the whole 110G. Maybe you have to give xargs one of -s, -n, or -L to avoid too long argument lists. On some distros it does a reasonable thing by itself.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.