Copies have different size? (EXT4)

Sorry for the stupid question, but I’m a newbie and recently installed Manjaro KDE with EXT4 file system.
If I make a copy of a folder from my OS drive to itself, the size of the copy is slightly different. Is this normal?

filesizediff

Its quite common for a copied folders to be slightly smaller than its source. Because additional blocks are allocated, as needed, to directories as files and sub-directories are added. The way to make an exact copy, including any extra blocks used, is with rsync.

rsync -avz /source-directory/ /backup-directory

But that only ends up copying wasted space.

1 Like

That small difference? Yes. Just a simple thing: ext4 uses extents when you modify/change data, which will be saved on additional 4k blocks. When you copy the modified files again, it tries always to write it without extents if possible as one block. Obviously a file which is fragmented with extends has more size than a de-fragmented one block.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.