Article 5NHZ5 2 identical files with different size

2 identical files with different size

by
Skaperen
from LinuxQuestions.org on (#5NHZ5)
i copied the same file to the same file system formatted with ext4 under 2 different names using the dd command. the files have the exact same size. sha256sum and md5sum show that the 2 files have the same content along with the original. the cmp command also compares them as equal. these 2 files have a different size allocation. the smaller one was written with the dd option bs=512. the larger one was written with the dd option bs=4096. the larger one must have something that takes more space since it uses more blocks. does anyone know what is going on? and how did writing a larger block size cause this?

i originally noticed that du -s gave a different result when i copied about 400GB of files from one disk to another (both ext4) using rsync. digging into this i saw that many files that were the same had different block allocation. so, i did some experimenting with dd and tried a block size difference.latest?d=yIl2AUoC8zA latest?i=YXCE6g0DFIg:iUKo1Q9te68:F7zBnMy latest?i=YXCE6g0DFIg:iUKo1Q9te68:V_sGLiP latest?d=qj6IDK7rITs latest?i=YXCE6g0DFIg:iUKo1Q9te68:gIN9vFwYXCE6g0DFIg
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments