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.
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.