April 6, 2024

Creating files bigger than available disk space!

spoiler: sparse files/holes in a file I was recently going through the book The Linux Programming Interface and came across the concept of sparse files. Files are stored on multiple blocks on a disk and sparse files is a smart optimization that skips allocating disk block if there is no data to be stored. You can create holes in your files by moving the file pointer n bytes ahead of the actual size and then writing some random data to it....