PROBLEM: same data differente Bytes

General support questions
Post Reply
Riccardo1987
Posts: 6
Joined: 2019/08/08 10:37:32

PROBLEM: same data differente Bytes

Post by Riccardo1987 » 2019/08/08 10:48:12

Hi,
I copy some directories from server 1 to server 2 with rsync -avr .
When I check if there are differences between source data and destination data with du -s the values are always difference, for example the source directory is 231349343 while the destination is 231337264.
Why are there this little difference?
Is there any better command to verify the consistence between source and destination?

Thank you so much.

Best regards.
Riccardo

tony_down_under
Posts: 83
Joined: 2019/08/07 01:50:24
Location: Perth, Australia but originally from Carshalton, Surrey

Re: PROBLEM: same data differente Bytes

Post by tony_down_under » 2019/08/08 11:25:23

Can you do this on both systems? `filename` is the name of the file you're copying.
1.

Code: Select all

sha256 filename
2.

Code: Select all

lsblk -f
The command in point 1 is one good way to determine that your file is the same on both systems.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: PROBLEM: same data differente Bytes

Post by TrevorH » 2019/08/08 12:09:12

You're using rsync -av. It already verifies the data.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Riccardo1987
Posts: 6
Joined: 2019/08/08 10:37:32

Re: PROBLEM: same data differente Bytes

Post by Riccardo1987 » 2019/08/08 12:40:19

tony_down_under wrote:
2019/08/08 11:25:23
Can you do this on both systems? `filename` is the name of the file you're copying.
1.

Code: Select all

sha256 filename
2.

Code: Select all

lsblk -f
The command in point 1 is one good way to determine that your file is the same on both systems.
Hi Tony,
Thank you. Now I test these solutions.
Best regards
Riccardo

I can't use sha256sum with directories but only with files. Are there any command to check folders?

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: PROBLEM: same data differente Bytes

Post by avij » 2019/08/08 14:55:03

"du" shows disk usage. Disk space is allocated in blocks. If the filesystem block sizes differ between the two systems, disk usage may differ between the systems. Try your "du" command with the "-b" option.

tony_down_under
Posts: 83
Joined: 2019/08/07 01:50:24
Location: Perth, Australia but originally from Carshalton, Surrey

Re: PROBLEM: same data differente Bytes

Post by tony_down_under » 2019/08/09 04:35:35

avij wrote:
2019/08/08 14:55:03
"du" shows disk usage. Disk space is allocated in blocks. If the filesystem block sizes differ between the two systems, disk usage may differ between the systems. Try your "du" command with the "-b" option.
Thanks for this info! My thought process was may be the filesystems were different formats in each. I didn't think about block sizes at the time. I'll also remember this
TrevorH wrote:
2019/08/08 12:09:12
You're using rsync -av. It already verifies the data.
Good info!

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: PROBLEM: same data differente Bytes

Post by desertcat » 2019/08/10 09:08:00

Riccardo1987 wrote:
2019/08/08 10:48:12
Hi,
I copy some directories from server 1 to server 2 with rsync -avr .
When I check if there are differences between source data and destination data with du -s the values are always difference, for example the source directory is 231349343 while the destination is 231337264.
Why are there this little difference?
Is there any better command to verify the consistence between source and destination?

Thank you so much.

Best regards.
Riccardo
I'm going to hate myself in the morning, BUT... I see you have taken a "Byte" out of Crime" :lol: :lol: :lol: :lol:

McGruff the Crime Cat

P.S. The DEVIL :twisted: made me do it -- REALLY!!!

Post Reply