From owner-freebsd-questions@FreeBSD.ORG Mon Feb 15 18:31:03 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5E9210656B0 for ; Mon, 15 Feb 2010 18:31:03 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.103.93]) by mx1.freebsd.org (Postfix) with ESMTP id AB30C8FC1C for ; Mon, 15 Feb 2010 18:31:03 +0000 (UTC) Received: from dc.cis.okstate.edu (localhost.cis.okstate.edu [127.0.0.1]) by dc.cis.okstate.edu (8.14.2/8.13.8) with ESMTP id o1FIUoX0001887 for ; Mon, 15 Feb 2010 12:30:55 -0600 (CST) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <201002151830.o1FIUoX0001887@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1885.1266258650.1@dc.cis.okstate.edu> Date: Mon, 15 Feb 2010 12:30:50 -0600 From: Martin McCormick Subject: Preparing to Install MFSBSD Loader on Disk 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: Mon, 15 Feb 2010 18:31:03 -0000 When one is logged in to a FreeBSD system, an attempt to write to the mounted file systems on /dev/ad0, for example, fails with "Operation not permitted." This is a wonderful feature 99% of the time because this is disastrous to any future access after that point. The only exception to this is if one wants to remotely rebuild the system at which point one needs to do something like dd if=mfsboot.img of=/dev/ad0 This is, of course, the end of all access to that drive as we presently know it so a reboot is the only other option and one must hope and pray that the mfsboot install worked. My experience so far is that mfsbsd works well but I would like to be able to do the whole operation without mailing out labeled CDR's or USB sticks. Each of our remote sites has 2 FreeBSD boxes and I can just see a hurried individual accidentally switching the media so we not only loose contact with the system we are rebuilding, but the boot CD will bring up mfsbsd on the very IP address of the backup system, crashing everything. One could use a temporary third address on the network that isn't either system A or System B, but I think I can use the parametric values in mfsbsd to configure the new server so it would be best to use the same addresses as normal for each device because of multiple firewalls that one may discover too late are not set right to allow the upgrade. I have been messing with automation for about 35 years and one of the few things I learned was that Murphy is naive and overly optimistic. In this case, Plan B is to have 1 CDROM on hand at the remote site in case we loose the box. That CD could have mfsbsd set to a third address and then also contain the boot images of both systems. My question today is whether there is any way to remotely get the mfsbsd.img data written to the boot drive and execute the reboot command. A document I read on this topic tells you to scp the image to the target system and then, as root, use dd to write it to disk. I was root when I discovered I couldn't do that. Thanks for any answers and, Kids, be really careful here. The dd operation totally destroys all existing partitions. What you get is partitions 1-3 are unused and partition 4 contains the mfsbsd image that will create the virtual disk with a baby OS when the reboot happens. Since you start with no actual drives mounted, you can reformat the hard drive to however you need it, but you can't reboot again until there is a working system back on the hard drive or you just get a warm, humming paperweight. That's when you need the rescue CD. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group