I want to understand what is going on inside of sparse files.

I have a test case set up.

I have a small directory tree set up containing just the systems running libraries. The directory tree contains a copy of the following systems directories, /bin. /lib, /libexec, /sbin, and /usr which has a combined size of 195M. This directory tree is what gets copied into the sparse files I create.

Now I create a sparse file with a allocated file size of 300M and copy that 195M directory tree into it.
ls -lh shows 300M as the allocation size
du -h  shows 270M as the occupied size

I would expect the occupied size to be 195M, the size of the source loaded into that sparse file.


Now I reran the same test again changing only the allocation size to 1G.
ls -lh shows 1G as the allocation size
du -h  shows 463M as the occupied size

So my question is, why does the occupied size not match the real size of the data content in the sparse file?

Also why as the allocated space increases does the occupied size increase?


_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to