Subject: Re: EZ-Clone?
To: Don Yuniskis" , "Port-SPARC <Port-SPARC@netbsd.org>
From: Brian Buhrow <buhrow@lothlorien.nfbcal.org>
List: port-sparc
Date: 11/27/2001 17:01:17
>perform the following steps.  We assume here that you have a working
>machine running NetBSD which is of the same architecture as the
>machine you want to install.

Hmmm... presumably becasue you are copying a binary off of
the working system and onto the "target" system (in step 5)?
	Yes, I'm assuming you have a working system with a full set of 
binaries for the machine you want to clone.  Note that you may have an
install housed on a machine which itself is not the machine running the
installation, i.e. an NFS server serving a bunch of diskless clients.  In
this instance, it's OK to copy the binaries from the NFS server to the
client, the machine you're turning into a clone of the other, without
worrying about the endianness of the NFS host.  For example, you have I386
binaries housed on a Sparc NFS server, that you want to copy to another
I386 host.  As long as the I386 binaries are fully self contained in their
own filesystems, you can dump |restore from the Sparc to the I386 with no
ill effects.  Dump and restore take care of any necessary byte swapping.


>5.  Copy /sbin/restore from the working system to your temporary 
>root drive.

Hmmm... at this point, isn't my / really MFS?

Yes, / is mfs, but there's space for restore, which is statically linked.
(All things in /sbin and /bin are statically linked.)
I'll have to verify restore is statically linked...

I assume I can just
   mount /dev/fd0a /mnt
   cp /mnt/restore /
   umount /mnt

Or, I guess I could copy it using ftp...?

>7.  Create a symlink from /tmp to a new /tmp directory on your newly
>mounted /mnt partition.


Hmmm... why?  Oh, perhaps restore likes to scribble there
Yes, it does, and the mfs filesystem doesn't contain enough space for these
scribbles.
as a staging area?

>8.  Now run something like the following to do the transfer.
>
>cd /mnt
>rsh <working system> /sbin/dump f0 - /dev/rwd0a |</path/to/restore> rf -


I don't understand the role of "f0" arg to dump?  (sorry, I don't 
use it!)  <:-(

It means dump the entire filesystem, level 0, to file "-" which in turn
means standard output.

>If you have more than one filesystem on the working system that you
>want to clone, make sure you dump each one in turn.  Before you dump, be
>sure to cd to the directory on your new system where the filesystem was
>mounted on the working machine.  For example, if you have /usr on the
>working system, and it is a different filesystem from /, then cd /mnt/usr
>on your new system before running the dump |restore pipe as shown above.


I assume the file system(s) in question shoul dbe reasonably quiescent?
Reasonably quiet, but not really quiet.  I wouldn't, for example, try to
copy a working news spool, but everything else, sure.

Argh!   I'll *try* and see ho wbig a mess I make!  :-/
Perhaps I should archive a tarball to tape just to be safe... :>

Probably not necessary since you're just trying to copy a working system to
make a new system.
-Brian

Thx!
--don