From owner-freebsd-questions@FreeBSD.ORG Sun Jan 11 14:23:30 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 C482F16A4CE for ; Sun, 11 Jan 2004 14:23:30 -0800 (PST) Received: from holodoc.ip.se (ua-213-115-163-137.cust.bredbandsbolaget.se [213.115.163.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89FF043D54 for ; Sun, 11 Jan 2004 14:23:21 -0800 (PST) (envelope-from rd@tilde.se) Received: by holodoc.ip.se (Postfix, from userid 103) id 6AA2812845A; Sun, 11 Jan 2004 23:21:08 +0100 (CET) Received: from nyalaptopen (c-f79572d5.02-85-73746f13.cust.bredbandsbolaget.se [213.114.149.247]) by holodoc.ip.se (Postfix) with ESMTP id 7B048128450; Sun, 11 Jan 2004 23:21:04 +0100 (CET) Message-ID: <041301c3d891$8214bac0$7001010a@nyalaptopen> From: "Rickard Dahlstrand" To: "Matthew Seaman" References: <00a301c3d832$16a40c00$7001010a@nyalaptopen> <20040111125114.GC10388@happy-idiot-talk.infracaninophile.co.uk> Date: Sun, 11 Jan 2004 23:23:15 +0100 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Sanitizer: This message has been sanitized! Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.1 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 22:23:31 -0000 Thanks for all the good answers. Just one final question. Do you think it is at all possible to do this update without rebooting? It = would save time but I assume that this is impossible. The reason I thinking of doing it this way is because I need to distribute = the update on a bootable cd. I need a method that is as failsafe as it can = be without any user-interaction (Except for turning the power switch). Thanks, Rickard. ----- Original Message -----=20 From: "Matthew Seaman" To: "Rickard Dahlstrand" Cc: Sent: Sunday, January 11, 2004 1:51 PM Subject: Re: automatic dump and restore over On Sun, Jan 11, 2004 at 12:00:12PM +0100, Rickard Dahlstrand wrote: >=20 > > All the servers is installed with one partition for /, one for /var/. W= hen I do the initial install I move the /etc to /var/etc and synlink /etc t= o point at /var/etc. This should make the / partition exactly the same on a= ll the servers. >=20 > 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. >=20 > > 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= my laptop from installation on all the other servers. > >=20 > > The laptop is then connected to the same network as the server that nee= ds 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 b= oots an image from the laptop containing a picobsd dist with a modified sta= rtup script.=20 > >=20 > > This script automatically mounts the hard drive on the server and a dir= ectory on the laptop containing the dump-file from the reference server. Th= en it uses restore to write the dump-file over the / partition on the serve= r. > >=20 > > After the upgrade is complete I reboot the server without the DHCP serv= er 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 b= acking up disks. Could there be any problems using restore on a partition a= lready allocated? >=20 > 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: >=20 > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/small-lan.h= tml >=20 > However, if you decide to stick with your first idea, then I'd make > a few changes: >=20 > 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. >=20 > 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 > --=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