Re: [SLUG] backup and restore with dd?

From: Mark Polhamus (meplists@earthlink.net)
Date: Sun Dec 08 2002 - 19:18:59 EST


Paul M Foster wrote:
> On Sat, Dec 07, 2002 at 10:18:05PM -0500, Greg Schmidt wrote:
>
>
>>I was thinking that I should be able to backup and restore an entire
>>partion with dd, but I thought I should run this idea by the list for a
>>sanity check before I actually try it. Something like:
>>
>>dd if=/dev/hdb1 of=~/partition.img
>>
>
>
> Here's the problem with dd: it will happily copy over bad sectors. And
> then, of course, your backup's useless. Rsync is a better alternative,
> and can be used to "update" a backup already in place. But rsync is a
> file-by-file, not an image backup. Avoid tar, as bad spots (for whatever
> reason) in the middle of a tar archive will invalidate the rest of the
> archive.
>
> Paul

There's a cool trick you can do with Rsync and cp -al to do multi-generation
backups that take up not much more space than the partition to be backed up.
See http://www.mikerubel.org/computers/rsync_snapshots/ and
http://slashdot.org/article.pl?sid=02/09/07/1630234&mode=thread&tid=106.
There is also http://www.stearns.org/rsync-backup/, but I haven't played with
that package.

I wrote a nice perl program to implement the method popularized by Mike Rubel,
but it's easy enough to throw together a quick shell script from his notes. I
use the technique to backup my laptop to an external hard disk. I currently
save 40 daily snapshots of /root (3.0G) in 5.9G. and 50 daily snapshots of
/home (5.6G) in 7.0G. Your mileage will of course vary depending on usage.
Be sure to read Mike Rubel's excellent notes and be aware of the limitations
of the technique.

You can also backup with Rdiff which I should look into. See
http://rdiff-backup.stanford.edu/. I'm guessing that rdiff would take longer
but use even less space, especially with large files that change every day.

-- Mark Polhamus



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:54:13 EDT