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
Forum Moderator
Posts: 28544
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.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. 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: 3039
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: 749
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

Return to “CentOS 7 - General Support”