From owner-freebsd-questions@FreeBSD.ORG Thu Nov 30 08:21:43 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D41016A403 for ; Thu, 30 Nov 2006 08:21:43 +0000 (UTC) (envelope-from jonathan@hst.org.za) Received: from sirian.hst.org.za (sirian.hst.org.za [209.203.2.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91B4A43CA2 for ; Thu, 30 Nov 2006 08:21:35 +0000 (GMT) (envelope-from jonathan@hst.org.za) Received: from localhost (localhost.hst.org.za [127.0.0.1]) by sirian.hst.org.za (Postfix) with ESMTP id AA57831C788 for ; Thu, 30 Nov 2006 10:27:50 +0200 (SAST) Received: from sirian.hst.org.za ([127.0.0.1]) by localhost (sirian.hst.org.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 98071-04 for ; Thu, 30 Nov 2006 10:27:50 +0200 (SAST) Received: by sirian.hst.org.za (Postfix, from userid 1004) id 9142D31C7A7; Thu, 30 Nov 2006 10:27:48 +0200 (SAST) Received: from sysadmin.int.dbn.hst.org.za (sysadmin.int.dbn.hst.org.za [10.1.1.20]) by sirian.hst.org.za (Postfix) with ESMTP id 787E431C78D for ; Thu, 30 Nov 2006 10:27:43 +0200 (SAST) From: Jonathan McKeown Organization: Health Systems Trust To: freebsd-questions@freebsd.org Date: Thu, 30 Nov 2006 10:26:28 +0200 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200611301026.28889.jonathan@hst.org.za> X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on sirian.hst.org.za X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=7.0 tests=BAYES_00 autolearn=ham version=2.61 X-Virus-Scanned: by amavisd-new at hst.org.za Subject: Remote upgrade 4.8 to 6.0 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Nov 2006 08:21:43 -0000 OK, I said I was intending to try this. I've carried out the following procedure on a test box in my office: before I do it with a live server 400 miles away, can anyone see any problems I've overlooked? I have two boxes on the remote site - call them server and gateway. I have ssh access to both boxes and a null-modem serial cable linking their serial ports. server is running FreeBSD 4.8 on an 80GB hard drive (ad0), and has a second brand-new 80GB hard drive (ad2). gateway is effectively acting as a serial terminal server. Copy the following files from a FreeBSD 6.0-RELEASE CD to ~root on server (I'm sure it works with 6.1 too, but 6.0 was what I had to hand for testing): boot/boot1 boot/boot2 boot/loader boot/mfsroot.gz boot/device.hints boot/kernel/kernel and edit device.hints to add set to the start of each line (that's ``set''). (I couldn't find another way to include the device hints when we get to that part of the loader sequence). Use disklabel to upgrade the boot blocks on the FreeBSD slice: disklabel -B -b /root/boot1 -s /root/boot2 ad0s1 This is so the bootloader will be able to read the UFS2 filesystem you are about to create. (Is it a problem to change the label on the slice rather than the root `a' partition within the slice - which you can't do with / mounted?) Establish the serial console link from gateway to server and echo ``/boot/loader -h'' >/boot.config on server. Reboot server, get past the initial bootblock prompt, and interrupt kernel booting to get to a loader prompt. Enter the following: unload load /root/kernel include /root/device.hints load -t mfs_root /root/mfsroot set vfs.root.mountfrom=ufs:/dev/md0c boot You are now running FreeBSD 6.0 sysinstall from a memory disk on a serial console. Carry out the installation on ad2 (in theory, you could actually do this on ad0 if you wanted to blow away your original installation and didn't have a spare drive installed), remembering to visit the configuration menu and edit /etc/ttys to enable serial console login. Because the install was done over a serial link, the installed system should be configured for serial console. Reboot. At the bootblock prompt, enter 1:ad(0,a) to boot from the new drive. You should now be running FreeBSD6 multiuser, with a serial console for login, off ad2, and you can configure it, copy data from the old installation on ad0, etc. (My intention is to set up ad2 as a gmirror drive at this point - there is the extremely unlikely, but possible, risk of loss of data from adding the metadata to the last sector. I want to take the risk early before transferring too much data!). If you reboot the box it will drop to a bootblock prompt from the 4.8 installation: if you want to change that, put 1:ad(0,a) -h in /boot.config. The BIOS will still start the boot process from ad0, the lowest-numbered drive, but the bootblock will switch over to the other drive. Once that's done, and the 4.8 installation is no longer needed, ad0 can be added to the mirror. Comments, anyone? Jonathan