[aklug] Re: Backing up an entire drive

From: Bruce Hill <bruce@slackwarebox.com>
Date: Thu Nov 12 2009 - 14:44:55 AKST

On Thu, Nov 12, 2009 at 02:08:31PM -0900, Christopher Howard wrote:

> Hey guys... I'm considering making an experimental change to one of my
> Gentoo systems (ripping out and replacing the default rc system with
> openrc). I wanted to back up my entire drive so that in the likely event
> that I render my system non-bootable and in pieces, I can just restore
> everything from a file/image. I've never had to back up an entire drive
> before because in the past I was simply concerned about certain
> irreplaceable data, but in this case I've got a whole dm-crypt + lvm
> disk configuration I want to preserve in a pristine state.
>
> I would appreciate any fatherly guidance about the best way to approach
> this for easy one-time backup and quick restoration (if necessary).
>
> - --
> Christopher Howard

I frequently backup entire Linux drives to USB enclosures with:

dd if=/dev/sda of=/dev/sdb conv=notrunc,noerror

NB: I use dcfldd rather than dd, for it's progress bar, primarily.

In this example, sda is the source, sdb is the target. Do not reverse the
intended source and target. Surprisingly many people do. notrunc means to not
truncate. noerror means to keep going if there is an error. Normally dd stops
at any error. if you have a question about a hard drive or whether or not it
works, you can try to use it as the source drive for the dd command. You
should get an error if it is not working. Target drives need to be really
messed up to give an error in dd.

If you do want to restore to the previous state, just reverse the order.

Bruce

-- 
"Experience is a hard teacher because she gives the test first, the
lesson afterward. But properly learned, the lesson forever changes
the man."
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu Nov 12 14:45:14 2009

This archive was generated by hypermail 2.1.8 : Thu Nov 12 2009 - 14:45:14 AKST