Sparse files

December 20, 2008 by V-Teq · Leave a Comment
Filed under: Linux Notes 

How to create ~20GB sparse file

A few days ago, I wanted to download some files using DC network via Linux DC++. The problem was, that I had a borrowed laptop with no files to share, so I decided to create a faked file – in my case sparse file.
This Unix-like command creates ~20GB sparse file. To be clear, it’s file size seems to be 20GB for most of applications (including Linux DC++), but in real it’s only about a few bytes long, just because of “seek”. Zeros needn’t to be physically stored in the harddisk, they’re simply seeked.

$ dd if=/dev/zero of=<FILE> bs=1 count=0 seek=20480M

Sparse files are available on most of Unix-like file systems. Microsoft implements sparse files since release of NTFS (fsutil).

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!