Sparse files allow filesystems to create files with huge logical sizes without allocating actual disk space for zero-filled regions. When a linker script places sections 8GiB apart in virtual address space, the resulting binary appears as 8GB in size but only occupies 12KB on disk. The filesystem stores extent mappings for actual data blocks while leaving holes unmapped—reading from holes returns zeros without disk I/O. You can create sparse files manually using truncate or dd with seek to generate petabyte-sized files consuming zero disk space.

3m read timeFrom fzakaria.com
Post cover image
Table of contents
Apparent size vs. on-disk sizeWhat is a sparse file?Creating sparse files yourself

Sort: