From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 29 22:14:32 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 C699037B401 for ; Tue, 29 Jul 2003 22:14:32 -0700 (PDT) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDFF243F3F for ; Tue, 29 Jul 2003 22:14:31 -0700 (PDT) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.12.9/8.12.9) with ESMTP id h6U5EP4D007975; Wed, 30 Jul 2003 09:14:25 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Wed, 30 Jul 2003 09:14:25 +0400 (MSD) From: Dmitry Morozovsky To: Joshua Oreman In-Reply-To: <20030729160048.GA4647@webserver> Message-ID: <20030730090934.L90518@woozle.rinet.ru> References: <200307291524.h6TFO3J06998@revolt.poohsticks.org> <20030729160048.GA4647@webserver> X-NCC-RegID: ru.rinet MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: sparse files from shell [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: Wed, 30 Jul 2003 05:14:33 -0000 On Tue, 29 Jul 2003, Joshua Oreman wrote: [snip] JO> Usually programs will manage their own sparse files; it's something hard JO> to do at the shell. dd is your friend. These commands make sparse file of some ks physical and 1g logical: VNFILE=/tmp/sparsefile VNSZ=$((1024*1024)) dd if=/dev/zero of=${VNFILE} bs=1k count=1 seek=$((${VNSZ} - 1)) Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------