[K12OSN] Got to rebulid -- how to take an image for checkpointing (Robert Moskowitz)

Matt Oquist moquist at majen.net
Fri Aug 25 18:30:01 UTC 2006


> Date: Thu, 24 Aug 2006 17:19:28 -0400
> From: "Robert Moskowitz" <rgm at htt-consult.com>
> Subject: [K12OSN] Got to rebulid -- how to take an image for checkpointing
> 
> I was in the habit with Win2000 to have GHOST images, so I could simply 
> go back in time.  It was really nice for test systems.
> 
> So how can I take a real good snap shot of my drive.  I would want 
> something like GHOST where I would boot from CD and image to a USB 
> harddrive or network drive....

With a (p)OS like Windows(TM), you need a "ghosting" program because
the system has loads of secret binary data that keep it from working
if you just copy the filesystem contents of the OS to another system.
Thankfully, Linux is part of the UNIX tradition and the entire system
is portable.

1. To create a complete, compressed, ready-to-roll system backup on a remote system:
$ cd /
$ tar czvf - / | ssh user at remotehost "cat > systembackup.tgz"

2. Or, if you like rsync and the compression of the backup isn't important to you:
$ ssh root at remotehost "mkdir /root/systembackup"
$ rsync -avuessh --exclude=/proc** --exclude=/sys** / root at remotehost:systembackup

#2 is also a way to duplicate a running system to another system... so
if you rsync to a fresh partition on the remotehost you can then boot
that partition and you'll be up and running.

Of course, you may want to change your network settings and hostname
on a duplicated host, and you can't boot unless you have a bootloader
installed and configured.

There are all kinds of ways to restore from either #1 or #2, all of
which will involve some form of copying the backed-up data onto
a fresh partition, ensuring your bootloader is installed and
configured, and booting your new-again system.

My favorite way to do this (harkening back to my Gentoo days) is to
boot a liveCD (pick a liveCD, any liveCD!), get a command line, use
fdisk, mkfs.ext3, and swapon to prepare my new system, make sure sshd
is running on the liveCD system (or use it as the ssh client depending
on the availability of 'rsync'), rsync or tar the backup onto my new
system, chroot into the new-again root filesystem and install grub
(the bootloader), reboot the liveCD system and take out the CD --
presto!

I used this method to move a single installation of Gentoo from my
original laptop through the next two laptops I had, all without
reinstalling. (This is meaningful when you run Gentoo...)

Linux isn't proprietary so there's no need for superstition - ghosting
is unnecessary.

I've never explored Mondo/mindi myself, but I expect that it must be
doing some automation of what I've just described here.

Going through this process is well worth your time; you'll learn more
about your system and it'll make you better at troubleshooting any
Linux system. (In fact, I still recommend running Gentoo for a while
if you haven't before, for exactly this reason.)

--matt

--
Open Source Software Engineering Consultant
http://majen.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/k12osn/attachments/20060825/52563a69/attachment.sig>


More information about the K12OSN mailing list