How to create holes in files ?

Ben RUBSON ben.rubson at gmail.com
Fri Sep 29 07:33:25 UTC 2017


> On 29 Sep 2017, at 09:21, Bakul Shah <bakul at bitblocks.com> wrote:
> 
> On Thu, 28 Sep 2017 16:39:28 +0200 Ben RUBSON <ben.rubson at gmail.com> wrote:
> Ben RUBSON writes:
>> Hi,
>> 
>> I'm trying to make holes in files in C.
>> Goal is to deallocate huge files on ZFS while (randomly) reading them.
>> 
>> The only thing I found is on Linux, fallocate(2) with FALLOC_FL_PUNCH_HOLE.
>> 
>> What about FreeBSD ?
> 
> You can copy such a file using rsync with -S or --sparse
> option or dd with conv=sparse option.

Unfortunately Bakul I would have liked to avoid copying data.


More information about the freebsd-fs mailing list