Subject: Re: EZ-Clone?
To: None <port-sparc@NetBSD.org>
From: Don Yuniskis <auryn@gci-net.com>
List: port-sparc
Date: 11/27/2001 17:26:45
Greetings and Titilations!  (sp?)

>der mouse went in der house:

>> What would be the quickest/easiest/least painful way to clone a
>> system?
>
>In my experience, it is to make sure that the clone has the very same
>drive type as the original (disk physical sticker labels are not always
>enough; I've seen two SCSI drives, both claiming the same STxxxN
>number, that reported different geometries to the kernel at boot time -
>I think one had special OEM firmware).  Then attach the new disk to the
>old system and boot single-user (or put both disks on a third system -
>the point is that the source disk is either unmounted or mounted
>read-only), and dd the whole disk over.  (Actually, I'd use blt, which
>gets significantly better I/O overlap than dd.  But dd comes with the
>stock system and blt doesn't.)


Yes, this is how I have done things in the past.  Most of my
drives are in external cases so this was easy.  But, the
SPARCs' drives are primarily internal so it's a PITA to
pull the drive and put it on another box...

>> I am guessing that I could use the install disks to get to a shell;
>> disklabel and newfs the drive(s); then transfer a giant tarball of
>> the source system's image piped into pax?
>
>Yes, you could do that too.  I've always found it easiest to install by
>putting the new disk on an already-working system, though, even if that
>means getting the "already-working system" by setting up diskless boot.

I have found the "miniroot" on swap to be a cute trick.

>> Is there a way to do this *without* storing the tarball on the source
>> machine fi[r]st?
>
>Yes.  I don't know whether stock tools can do it, but with help of
>netcat or something like it, it borders on trivial.
>
>oldmachine# tar + c f - i-full /dev/rsd0a S + . | nc 40051
>newmachine# nc -holdstdin oldmachine 40051 < /dev/null | tar xfppS -
>
>(The oldmachine tar command given above is for my tar, to read the disk
>directly and give exactly what's there; you may just "tar cf - ." with
>stock tar.)

Hmmm... I will have to explore this.

Thanks!
--don

P.S. is it worth adding a "clone" option to the install menu?
I would assume this would be a real easy way for folks to bring up
a new box -- clone your friend's and then edit /etc, etc.