From owner-freebsd-questions@FreeBSD.ORG Sun Jan 11 04:51:21 2004 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 F2E4E16A4CE for ; Sun, 11 Jan 2004 04:51:20 -0800 (PST) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7695C43D46 for ; Sun, 11 Jan 2004 04:51:18 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i0BCpEfn011337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Jan 2004 12:51:14 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i0BCpE6j011336; Sun, 11 Jan 2004 12:51:14 GMT (envelope-from matthew) Date: Sun, 11 Jan 2004 12:51:14 +0000 From: Matthew Seaman To: Rickard Dahlstrand Message-ID: <20040111125114.GC10388@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Rickard Dahlstrand , freebsd-questions@freebsd.org References: <00a301c3d832$16a40c00$7001010a@nyalaptopen> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R+My9LyyhiUvIEro" Content-Disposition: inline In-Reply-To: <00a301c3d832$16a40c00$7001010a@nyalaptopen> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.61 X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: automatic dump and restore over 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: Sun, 11 Jan 2004 12:51:21 -0000 --R+My9LyyhiUvIEro Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 11, 2004 at 12:00:12PM +0100, Rickard Dahlstrand wrote: > All the servers is installed with one partition for /, one for /var/. Whe= n I do the initial install I move the /etc to /var/etc and synlink /etc to = point at /var/etc. This should make the / partition exactly the same on all= the servers. If you move /etc like this, you'll make the machines so treated unbootable. There's critical stuff in /etc that has to be in the root partition for the boot process to be able to find it. > On the reference server (where I do all the upgrades) I then use dump to= create a file from the / partition. This file is the zipped and moved to m= y laptop from installation on all the other servers. >=20 > The laptop is then connected to the same network as the server that needs= upgrading. The laptop is running DHCP, TFTP and NFS services. >=20 > All servers are set to boot using PXE and once I reboot it the server boo= ts an image from the laptop containing a picobsd dist with a modified start= up script.=20 >=20 > This script automatically mounts the hard drive on the server and a direc= tory on the laptop containing the dump-file from the reference server. Then= it uses restore to write the dump-file over the / partition on the server. >=20 > After the upgrade is complete I reboot the server without the DHCP server= active and the server should boot using the new / partition. >=20 > Can this work? I have read that dump/restore is the best solution for bac= king up disks. Could there be any problems using restore on a partition alr= eady allocated? It strikes me as a lot more complicated than the recommended method, which is to designate one machine as a 'build box', where you build all of the OS and kernels you need. You then NFS export /usr/src and /usr/obj and mount them on the machine you want to update. Then you can use 'make installkernel', 'make installworld' and 'mergemaster' to do the update. Possibly with a few other steps here and there -- for full instructions start with: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/small-lan.html However, if you decide to stick with your first idea, then I'd make a few changes: i) Copy the contents of /etc to your /var as a backup. Leave the original /etc in place on the root partition. If you're going to be doing this sort of thing regularly, then you can set up a cron(8) job: the net/rsync port will let you do the copies very efficiently. ii) Before you rewrite your root partition, you should run newfs(8) on it to blank it. restore(8) can overwrite a populated partition, but it works best given an empty filesystem. =20 iii) After you've restored your example root partition, copy back the contents of /etc. Note that this will wipe out any updates to files within /etc which came as part of the upgrade. mergemaster(8) will help you fix things up, or you can be selective about what contents of /etc you actually keep backed up --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --R+My9LyyhiUvIEro Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAAUbCdtESqEQa7a0RAmsYAKCKUgPTsuU9KgU2RAPeoAiW2E7kawCdHSx9 zXTV2XMus4rlzewc9+XGvBA= =wN6A -----END PGP SIGNATURE----- --R+My9LyyhiUvIEro--