From owner-freebsd-questions@FreeBSD.ORG Thu Oct 30 05:10:51 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94B3A16A4CE for ; Thu, 30 Oct 2003 05:10:51 -0800 (PST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 295C643FE5 for ; Thu, 30 Oct 2003 05:10:50 -0800 (PST) (envelope-from malcolm.kay@internode.on.net) Received: from beta.home (ppp107-193.lns1.adl1.internode.on.net [150.101.107.193])h9UDAgTn033511; Thu, 30 Oct 2003 23:40:47 +1030 (CST) From: Malcolm Kay Organization: At home To: a@jenisch.at, freebsd-questions@freebsd.org Date: Thu, 30 Oct 2003 23:40:41 +1030 User-Agent: KMail/1.4.3 References: <20031030091948.GB2776@athena.oekb.co.at> In-Reply-To: <20031030091948.GB2776@athena.oekb.co.at> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_T9NK4JB2DS0BYSXHFO6J" Message-Id: <200310302340.41896.malcolm.kay@internode.on.net> X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Re: Cloning FreeBSD installations? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2003 13:10:51 -0000 --------------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--