1

I have two discs labeled T1 and T2 with ext2 filesystem on them connected through USB port into computer.

They are identical copies, I synchronize them regularly with rsync -ahvt --delete --progress T1/ T2.

When I check them with find /run/media/jonash/T1/ | wc -l and find /run/media/jonash/T2/ | wc -l the result is same.

Then I do check with find /run/media/jonash/T1/ -printf "%P\n" | sort > file1 and find /run/media/jonash/T2/ -printf "%P\n" | sort | diff file1. Result is that filesystem structure is same.

With df -h, result is:

Filesystem      Size  Used Avail Use% Mounted on
...
/dev/sdb1       917G  698G  220G  77% /run/media/jonash/T1
/dev/sdc1       917G  914G  3.0G 100% /run/media/jonash/T2

They differ in free/allocated space (see Used and Avail columns). Checking with dumpe2fs /dev/[sdb1|sdc1] | grep 'Block size' is identical on booth discs.

Result of the tune2fs on discs is (not relevant parts removed):

Filesystem volume name:   T1
Filesystem features:      ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Inode count:              61054976
Block count:              244190638
Reserved block count:     0
Free blocks:              57527854
Free inodes:              60305106
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      965
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Default directory hash:   half_md4

Filesystem volume name:   T2
Filesystem features:      ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Inode count:              61054976
Block count:              244190638
Reserved block count:     0
Free blocks:              765286
Free inodes:              60305106
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      965
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Default directory hash:   half_md4

Does someone know where is the problem?

1 Answer 1

2

My guess is you rsynced without -HS, so that hardlinked files in the original are not hardlinked in the copy, and sparse files in the original are not sparse in the copy.

You can verify the first hypothesis doing something like

diff -u <(find /run/media/jonash/T1/ -type -f links +1) <(find /run/media/jonash/T2/ -type f -links +1)

Finding sparse files is slightly more difficult:

diff -u <(du -hsc /run/media/jonash/T1/*) <(du -hsc /run/media/jonash/T2/*)

Then see which directories show a different size, and drill down till you find files where du -h reports a smaller size than du -h --apparent-size.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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