From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: util-linux-owner@vger.kernel.org Received: from alerce.vps.bitfolk.com ([85.119.82.134]:44610 "EHLO alerce.vps.bitfolk.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753201AbaAWWGk (ORCPT ); Thu, 23 Jan 2014 17:06:40 -0500 Received: from 87-198-57-52.ptr.magnet.ie ([87.198.57.52] helo=sdfg.com.ar) by alerce.vps.bitfolk.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1W6U7G-0004zB-Bm for util-linux@vger.kernel.org; Thu, 23 Jan 2014 20:55:22 -0300 Date: Thu, 23 Jan 2014 21:28:13 +0000 From: Rodrigo Campos To: util-linux@vger.kernel.org Subject: drill: Make a file sparse without using extra disk space Message-ID: <20140123212813.GE20054@sdfg.com.ar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: util-linux-owner@vger.kernel.org List-ID: Hi! I've written a small simple tool to make a file sparse without using extra disk space, it just digs holes on the file when possible. To dig the hole uses the Linux-specific fallocate(2) syscall with FALLOC_FL_PUNCH_HOLE. So, also, it only works on some file-systems. Do you think that util-linux would be a good place for such a simple, linux-only program ? The case I see it can be useful is to use on VM images file backed (or I wrote it with this in mind, at least :)). The code is quite simple, it's written in plain C (C99 actually) and doesn't have any external dependencies. You can see the gitweb here: http://sdfg.com.ar/git/?p=drill.git or just clone it from: git://sdfg.com.ar/drill.git Given that there is a fallocate tool that uses the other mode of fallocate(2) already, all the detection for fallocate is already there. So it should, I guess, be easy to integrate to the code-base, adding also the #ifndef fallocate.c has and that compatibility stuff. Also, as you can see in the commits, I just started it some days ago. So if you think it should have some other feature, or something else, please let me know :) I'm not sure how this work, but I can write a patch against util-linux if you think it can be added. If you know there is something I should particulary take into account for that, I will really appreciate if you let me know :) Thanks a lot, Rodrigo