Subject: Re: EZ-Clone?
To: None <port-sparc@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 11/27/2001 17:34:52
> 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.)

> 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.

> 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.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B