From owner-freebsd-questions@FreeBSD.ORG Thu Aug 16 17:43:42 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3050616A41A for ; Thu, 16 Aug 2007 17:43:42 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr10.xs4all.nl (smtp-vbr10.xs4all.nl [194.109.24.30]) by mx1.freebsd.org (Postfix) with ESMTP id D0C2F13C468 for ; Thu, 16 Aug 2007 17:43:41 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr10.xs4all.nl (8.13.8/8.13.8) with ESMTP id l7GHhdeR082957; Thu, 16 Aug 2007 19:43:39 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id F0A69B829; Thu, 16 Aug 2007 19:43:38 +0200 (CEST) Date: Thu, 16 Aug 2007 19:43:38 +0200 From: Roland Smith To: Grant Peel Message-ID: <20070816174338.GB97696@slackbox.xs4all.nl> Mail-Followup-To: Grant Peel , freebsd-questions@freebsd.org References: <00b601c7e003$fb1e0200$6501a8c0@GRANT> <200708160910.14095.lists@jnielsen.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U+BazGySraz5kW0T" Content-Disposition: inline In-Reply-To: <200708160910.14095.lists@jnielsen.net> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: Dump + GZIP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2007 17:43:42 -0000 --U+BazGySraz5kW0T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 16, 2007 at 09:10:12AM -0400, John Nielsen wrote: > On Thursday 16 August 2007, Grant Peel wrote: > > Can I safely pump a filesystem dump through gzip during the dumping > > process?, or di I need to create the dump first then gzip it after? >=20 > I do it all the time: dump -f - ... | gzip > date_filesystem.dump.gz > or with bzip2: dump -f - ... | bzip2 > date_filesystem.dump.bz2 Unless you're dumping an unmounted filesystem, add '-L' and '-h 0'. The first is for dumping a snapshot of a live filesystem, and the second one is to honor the nodump flag for level 0 dumps. =20 > > Does zipping the dumps cause any headaches at restore time? >=20 > Nope: bzcat date_filesystem.dump.bz2 | restore ... -f - >=20 > > (I currently dump 5 servers worth of data to a raid 5 array, and am abo= ut > > 20% away from running out of disk space). > > > > Does gzipping a file give a decent compression ratio? >=20 > Depends on what you're compressing, but generally yes. bzip2 generally=20 > compresses better but takes a lot more time, CPU and memory at compressio= n=20 > time. Some time ago I did some tests. Compression with gzip saved 50-60% on dumps of /, /usr and /var. However, the savings for my /home partition which contains a lot of digital camera pictures in JPEG format was only 11%. While bzip2 did 8-10% better (except on /home), it takes a _lot_ longer. So at first I decided to stick with gzip. Later I decided to skip compression altogether. If the backup medium becomes corrupted, you might still be able to restore the dump for a large part. Corruption in a compressed file makes the rest of the file unreadable.=20 If you don't compress the dumps, it's easy to split them in multiple DVD sized parts. The size of a dump is given in kiB, and it must be a multiple of the block size, which defaults to 10 kiB. A DVD is 4.7 GB =3D (4.7e9/1024//10)*10 =3D 4589840 kiB. The following command creates a dump of /home in multiple DVD-sized chunks; dump -0 -B 4589840 -C 8 -P 'cat - >home-vol${DUMP_VOLUME}.dump' -h 0 -L /= home You can burn these chunks to DVDs with growisofs, e.g: growisofs -dvd-compat -Z /dev/dvd=3Dhome-vol0.dump growisofs -dvd-compat -Z /dev/dvd=3Dhome-vol1.dump ... In this case you do need temporary storage for the dump files. You could conveivably modify the argument of -P to burn directly with growisofs. One caution for backups though. Use only programs that are available on a install CD or in /rescue. Your restore process should not depend on a port that you need to install first! Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --U+BazGySraz5kW0T Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGxIzKEnfvsMMhpyURAne3AKCVheu1beYhqWcUq8aOVLWOCQBSLACeOHaQ OwjrAKzhtT/SGhg4DwsWWtg= =Y11E -----END PGP SIGNATURE----- --U+BazGySraz5kW0T--