From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Chinner Subject: Re: bdar: efficiently backup allocated bytes in file systems Date: Wed, 19 Mar 2008 08:35:43 +1100 Message-ID: <20080318213543.GC155407@sgi.com> References: <47DF1737.2050700@zabbo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Zach Brown Return-path: Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:42973 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756662AbYCSTgB (ORCPT ); Wed, 19 Mar 2008 15:36:01 -0400 Content-Disposition: inline In-Reply-To: <47DF1737.2050700@zabbo.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Mar 17, 2008 at 06:13:27PM -0700, Zach Brown wrote: > So, I had a fun time throwing together a utility last weekend. I > thought I'd share it sooner rather than later. > > I found myself wanting to backup a copy of an ancient ~75g ext3 file > system. I got frustrated by of our utilities which don't saturate > storage. I wanted dd line rates but I also only wanted to copy > referenced data. > > So I threw something together which does that. I made it work roughly > like tar so that people have some idea what to expect. So you can do > something like: > > $ bdar -cf - /dev/sda3 | gzip -c > /tmp/sda3-backup.bdar.gz > ... > $ zcat /tmp/sda3-backup.bdar.gz | bdar -xf - /dev/sda3 > > and it will do exactly what you would guess it would do after reading > those command lines. > > The bdar file format is just a header and then a series of regions of > bytes described by their length and offset. To create a bdar file from > a file system bdar needs to know enough to figure out what extents are > referenced. Restoring a bdar is generic, though, it just stamps bytes > into the target file. Neat, Zach. You should look at xfs_copy - it does pretty much this for XFS filesystems.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group