Date: Sun, 11 Jan 2004 12:51:14 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Rickard Dahlstrand <rd@tilde.se> Cc: freebsd-questions@freebsd.org Subject: Re: automatic dump and restore over Message-ID: <20040111125114.GC10388@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <00a301c3d832$16a40c00$7001010a@nyalaptopen> References: <00a301c3d832$16a40c00$7001010a@nyalaptopen>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040111125114.GC10388>