TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:13238] cloning machines



On Wed, Feb 02, 2000 at 12:19:05PM -0600, Timothy Wilson wrote:
> Hi everyone,
> 
> Here's a quick question about cloning (or duplicating) machines.
> 
> I'd like to create an image of a HD and save it on my server so I can
> easily upgrade or install Linux on a bunch of little 486s in short order.
> I know that the RedHat Kickstart program will automate installation, but
> I'd like to go one step easier than that.
> 
> These machines all NFS-mount /home from the server. Obviously, I need the
> 'dd' command, but I'm not sure how to proceed to create the image, and
> further, how to install the image once it's created. I don't have room to
> save the image (even with compression) on the local drive of one of the
> 486s. How would I create remotely then? Would someone give me a swat with
> the clue stick?
> 
> -Tim
> 
> --
> Tim Wilson        | Visit Sibley online:         | Check out:
> Henry Sibley H.S. | http://www.isd197.k12.mn.us/ | http://www.zope.org/
> W. St. Paul, MN   |                              | http://slashdot.org/
> wilson@visi.com   |   <dtml-var pithy_quote>     | http://linux.com/

This is relatively simple, although it may not work if there are different
models of HDs in use (anyone know if this matters at all?).

1)  NFS-mount a directory on the server read-write.
2)  Make sure that the partition in question isn't mounted read-write.
3)  dd if=/dev/hda2 of=/path/to/nfs/mounted/directory/diskimage.ext2
4)  Wait...

In this case, you'd replace /dev/hda2 with whatever partition you had in mind
for it.  You'd need to make sure that the destination drive had the same
partition type and size when you wrote it back.  If the destination drive is
the same make and model as the source drive, /dev/hda might work for the
entire drive, and should copy the partition table along with everything
else.

Restoring it is also simple:

1)  Boot off a rescue disk/CD with network support.
2)  NFS-mount the directory where the image file resides (read-only is fine).
3)  Be sure that a suitable partition exists (if you backed up a partition).
4)  dd if=/path/to/nfs/mounted/directory/diskimage.ext2 of=/dev/hda2
5)  Wait...

Replace all paths and filenames with the real ones, of course... :)  You'll
want to try it out on some unimportant drives first, just to be sure there
aren't any unforseen errors.  An fsck on the cloned partition(s) would also
be good.

If I'm totally off-base here, I'm sure someone will say so in short order.

	David

-- 
David Carter ** dcarter@visi.com
Network Engineer -- VISI.com
PGP Key 581CBE61: E07EE199C767C752 8A8B1A9F015BF2EA 
Key available by finger or www.keyserver.net.