Date: Thu, 28 Sep 2017 18:47:03 +0200 From: Ben RUBSON <ben.rubson@gmail.com> To: Freebsd fs <freebsd-fs@freebsd.org> Subject: Re: How to create holes in files ? Message-ID: <6B96C3C6-44D0-4BE3-B5A1-3533BBAB6B92@gmail.com> In-Reply-To: <20170928173428.42d1619c@raksha.tavi.co.uk> References: <44E32501-4213-4A09-992C-92DB4EF33C0C@gmail.com> <20170928172609.0e6d5c77@fabiankeil.de> <20170928173428.42d1619c@raksha.tavi.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
> On 28 Sep 2017, at 18:34, Bob Eager <rde@tavi.co.uk> wrote: > > On Thu, 28 Sep 2017 17:26:09 +0200 > Fabian Keil <freebsd-listen@fabiankeil.de> wrote: > >> Ben RUBSON <ben.rubson@gmail.com> wrote: >> >>> I'm trying to make holes in files in C. >>> Goal is to deallocate huge files on ZFS while (randomly) reading >>> them. >> >> My interpretation of the above is that you want to create holes >> without changing the file size and without affecting data that >> is located before or after the holes that you want to create. >> >> Otherwise you could simply "deallocate" the content with >> truncate(1). > > If he doesn't mind copying the files, dd(1) will do the job. However, I > expect that doesn't meet his criteria. Thank you Bob for your suggestion. You're right goal is to avoid copying data : free space would not necessarily allow this, and as the files I'm working on are some hundreds of GB in size, it would really be a counterproductive long stressing storage operation. Ben
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6B96C3C6-44D0-4BE3-B5A1-3533BBAB6B92>