2 ms·
dd will create sparse files if you use the seek option, like: dd if=/dev/zero of=a_sparse_file bs=1 count=0 seek=8G
by tyingq 6y ago
dd will create sparse files if you use the seek option, like:
dd if=/dev/zero of=a_sparse_file bs=1 count=0 seek=8G
- bombcar 6y agoYou have to beware if you're on a filesystem (such as ZFS) that has compression enabled. A file of all zeros compresses quite well, and may not get you the space you need when you remove it.
- zepearl 6y agoYep - but I think that I was using ext4 and/or xfs when I was seeing that happening... .
- zepearl 6y agoThank you. I actually never used that seek-option, but I still think that what I wrote did happen. Mistery... .