Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Oct 2003 23:40:41 +1030
From:      Malcolm Kay <malcolm.kay@internode.on.net>
To:        a@jenisch.at, freebsd-questions@freebsd.org
Subject:   Re: Cloning FreeBSD installations?
Message-ID:  <200310302340.41896.malcolm.kay@internode.on.net>
In-Reply-To: <20031030091948.GB2776@athena.oekb.co.at>
References:  <20031030091948.GB2776@athena.oekb.co.at>

next in thread | previous in thread | raw e-mail | index | archive | help

--------------Boundary-00=_T9NK4JB2DS0BYSXHFO6J
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Thu, 30 Oct 2003 19:49, a@jenisch.at wrote:
> Hi,
>
> I'm about to set up several identical machines (identical hardware
> both in terms of processor, harddisk, LAN etc.) with FreeBSD 4.9. The
> only difference between these machines is they're running under
> different IP-addresses - all the rest (kernel, software,...) should be
> identical.
>

I suggest you probably also want different host names.
I had a similar task to create clones of a machine 'phoenix00'
as machines 'phoenix01' to 'phoenix14' for which I wrote (and used)
the attached script.

The original machine had ip 192.168.3.237 and the clones were to have ip
addresses in the range 192.168.3.211 to 192.168.3.249

The original system is in partitions ad0s1a, ad0s1e, ad0s1f and ads1g wit=
h
swap on ad01b.

To use the script attach the (identical) drive to as ad1 to 'phoenix00'
and call the script (as root):-
(There is no secondary IDE port on the machines in question which might h=
ave=20
been somewhat faster)
=20
# ./clone.sh ip mach
where ip is the last group for the required ip and mach is the numeric pa=
rt
of the clone host name 'phoenixNN'.

The script copies the MBR and disklabel from ad0 to ad1 and then creates =
the=20
file systems and copies data with dump and restore. The cloned configurat=
ion
file /etc/rc.conf is edited using 'sed' to update the ip address and host=
name.

Plug the cloned disk into the new machine (as ad0) and it should boot wit=
hout=20
problems (remembering to fix master/slave links on the disk).

Adapt, use and enjoy.

> In order to keep installation effort at a minimum I'm looking for a
> way to "clone" FreeBSD installations from one machine to another.
>
> To be specific:
>
> o) Is there a way to clone one machine to another one "over the net",
> i.e. by writing an image file from one machine to a server and then
> setting up the other machines from that image?
>

Probably but would need more preparatory work.

> o) Is there a way to clone FreeBSD installations by copying the entire
> FreeBSD slice to another drive (I thought about installing the
> harddisks of the other machines in the master machines and then
> copying the installtion) (Is "Knoppix" capable of doing this?)
>

I don't know Knoppix but if you have large disks any literal byte to byte=
=20
disk copying will take quite a while. Should also be possible with dd
but if the source is mounted rw at the time the copy will not appear to b=
e=20
clean when booted in the new machine.


Malcolm Kay
--------------Boundary-00=_T9NK4JB2DS0BYSXHFO6J--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200310302340.41896.malcolm.kay>