From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 29 09:02:20 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29BB937B404 for ; Tue, 29 Jul 2003 09:02:20 -0700 (PDT) Received: from smtp-out4.blueyonder.co.uk (smtp-out4.blueyonder.co.uk [195.188.213.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90CDD43F75 for ; Tue, 29 Jul 2003 09:02:18 -0700 (PDT) (envelope-from bruce@cran.org.uk) Received: from buffy.brucec.backnet ([82.41.200.71]) by smtp-out4.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600); Tue, 29 Jul 2003 17:02:16 +0100 Received: from buffy.brucec.backnet (localhost [127.0.0.1]) by buffy.brucec.backnet (8.12.9/8.12.9) with ESMTP id h6TG2G1s004013; Tue, 29 Jul 2003 17:02:16 +0100 (BST) (envelope-from bruce@buffy.brucec.backnet) Received: (from bruce@localhost) by buffy.brucec.backnet (8.12.9/8.12.9/Submit) id h6TG2Gv4004012; Tue, 29 Jul 2003 17:02:16 +0100 (BST) Date: Tue, 29 Jul 2003 17:02:15 +0100 From: Bruce Cran To: Bogdan TARU Message-ID: <20030729160215.GA3822@buffy.brucec.backnet> References: <200307291524.h6TFO3J06998@revolt.poohsticks.org> <20030729172615.N13255-100000@fw.office.icom> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030729172615.N13255-100000@fw.office.icom> User-Agent: Mutt/1.4.1i X-OriginalArrivalTime: 29 Jul 2003 16:02:16.0802 (UTC) FILETIME=[C851D420:01C355EA] cc: freebsd-hackers@freebsd.org Subject: Re: file size different from ls to du X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2003 16:02:20 -0000 On Tue, Jul 29, 2003 at 05:27:14PM +0200, Bogdan TARU wrote: > > Hi Drew, > > I have tried to create some files of myself, with 'spaces' in them > (holes?), but they don't act like this. So could you please explain what > 'sparse' means, and the 'trick' to create them? > Try using the 'truncate' utility: truncate -s 102400G onehundred_terabytes This will create a file which looks like it's 100TB though 'ls', but which only uses 64KB in the directory usage via 'du'. Generally, creating a file, seeking past the end of the file then writing something, will create a 'sparse' file. This, when read, will appear to contain zeros for all entries past the previous end of file, to the entry which was written to. -- Bruce Cran