Efficiently Copy Large Sparse Files with SEEK_HOLE and SEEK_DATA
Archiving or copying a 1TB sparse file containing only 32MB of actual data is impractical with naive approaches—you’ll waste time and I/O bandwidth copying zeros. The solution is using SEEK_HOLE and SEEK_DATA flags with lseek(), which allow tools to skip over hole regions entirely. How SEEK_HOLE and SEEK_DATA work The Linux kernel provides two additional…
