Files are not stored on disks in bytes. They are stored in blocks.
Some tools (du, df, some ls options) display space use in terms of bytes, but the bytes are typically multiples of the underlying block size. If the block size between the disks is different between source and target disks, file size can be rounded up differently. The command du --apparent-size
looks at file length instead of file size and is more likely to be identical between copied directories. However --apparent-size
is also an estimate and may not be identical in every situation.
Additionally, if the two disks are different filesystem types (check with df -T
) then file metadata is stored differently and is very likely to be a different size.
As pointed out in the other answer, even if the disks have identical block size and identical filesystem format, space to store metadata in directories is not immediately reclaimed when files are deleted, so directories are likely to not be the same size.
Be aware that commands like du
estimate space use and make guesses at underlying metadata storage. Commands like df
show exact space use, but include metadata storage that may not directly correspond to file storage sizes. Graphical tools pull their data from the same sources and will have the same inaccuracies.
File count and apparent size matches are a better indicator if all the files were copied correctly, but this of course is a fast guess, not a guarantee.