different sizes of directories? why?
Hello,
I just made a backup of a directory with the command "cp -Rp folder /backup/" Then I wanted to make sure that the contents are the same by running "du -bcs" in both directories. Turns out that the original directory was using 4096 bytes more than the backup directory; this was caused by the size of the directoy... original directoy uses: 8192 bytes backup directoy uses: 4096 bytes Why is this? I mean it is an exact copy of the original directory. Can anyone please explain why sometimes a directoy 'claims' more bytes than another directory? Thanks in advance! |
You'll note that's a multiple of 4k. That's the min size of the next block. When there's a been a lot of additions and deletions, the dir file can end up with gaps.
By rebuilding it from scratch you can lose those. https://en.wikipedia.org/wiki/Inode http://www.cs.nyu.edu/courses/spring...ecture-24.html |
Thanks alot...very clear to me now.
So is it roughly to compare like a directory being a 'partition' and when there has been more action within it it becomes more 'fragmented'? |
All times are GMT -5. The time now is 12:27 PM. |