I totally understand that --dig-holes creates a sparse file in-place. That is, if the file has holes --dig-holes options removes those holes:
Let's take it in a very simplified way, let's say we have a huge file named non-sparse:
non-sparse:
aaaaaaaaaaaaaaaaaaaaaaaaaaaa
\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00
bbbbbbbbbbbbbbbbbbbbbbbbbbbb
\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00
cccccccccccccccccccccccccccc
non-sparse has many zeros in it, assume that the interleaving zeros are in Gigabytes. fallocate --dig-holes de-allocates the space available for the zeros (holes) where the actual file size remains the same (preserved).
Now, there's --punch-hole what does it really do? I read the man page, still don't understand:
-p, --punch-hole
Deallocates space (i.e., creates a hole) in the byte range
starting at offset and continuing for length bytes. Within
the specified range, partial filesystem blocks are zeroed,
and whole filesystem blocks are removed from the file.
After a successful call, subsequent reads from this range
will return zeroes.
Creating hole, that's the opposite of --dig-hole option it seems like that, and how come that digging a hole isn't the same as creating a hole?! Help! we need a logician :).
The naming of the two options are synonymous linguistically which perhaps makes confusion.
What's the difference between --dig-holes and --punch-holes operationally (not logically or linguistically please!)?