From owner-freebsd-questions@FreeBSD.ORG Fri Aug 5 19:43:54 2005 Return-Path: X-Original-To: freebsd-questions@FreeBSD.org 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 CDB8016A41F for ; Fri, 5 Aug 2005 19:43:54 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D5CF43D46 for ; Fri, 5 Aug 2005 19:43:54 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.13.0/8.13.0) with ESMTP id j75Jhnr2029748; Fri, 5 Aug 2005 15:43:51 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Fri, 5 Aug 2005 15:43:49 -0400 To: Michael Dexter From: Garance A Drosehn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) on 128.113.2.3 Cc: freebsd-questions@FreeBSD.org Subject: Re: 5.x separate /boot slice? 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: Fri, 05 Aug 2005 19:43:54 -0000 While this is a reply to a private message, I'm also sending it back to freebsd-questions. I would rather not spend this much time writing up information for a general topic, and then send it to just one person... Given how often this topic comes up, my hope is that other users might find these notes somewhat helpful. You had several good questions that are probably of general interest. At 2:42 PM +0300 8/5/05, Michael Dexter wrote: >Hello, > >>At 12:56 AM +0300 8/5/05, Michael Dexter wrote: >>>>> I would like to try a separate /boot slice as permitted >>>>>by FreeBSD 5.x... >> >>I missed the beginning of this thread. Where did you get the >>impression that FreeBSD will work if you create /boot as a >>separate partition? > >http://www.khmere.com/freebsd_book/html/ch08.html Ah. That page is basically correct, as far as it goes, but I think you're drawing the wrong conclusion from it... 5.x did switch to moving most boot-related files into /boot, and that does make it easier to sync boot-files between different partitions. But the page doesn't actually say that /boot is a separate partition. And indeed, it won't work if you try to make /boot a separate partition from '/'. >>I do exactly what you'd like to do, but the partition I >>duplicate is '/'. > >Are you sharing /var and /tmp between the current and >updated systems? Well, yes. Although I guess what I do is more like the opposite of what you do. I create a backup of the active system, and then install into that active system. So, I only need my /xRoot (backup) if something goes wrong. I am a FreeBSD developer, and I am both tracking the cutting-edge branch (-current) and writing my own little changes. So, I'm more likely to see something go wrong than most people are... In any case, I'm not sure the install process will support what you would want to do (if you tried doing what I do...). You can't say "install part of this build into /xRoot, and other parts into /usr", and you can't mount /usr onto two different places at the same time. (so you couldn't mount it as /usr and /xRoot/usr). >>I have a '/' partition and a '/xRoot' partition, and I >>use FreeBSD's snapshot feature (in 5.x and better) to >>duplicate that partition into /xRoot. > >I was planning for a fresh install but seemingly rsync >would give a similar effect. Why snapshots in this case? Snapshots just give you a consistent snapshot of the active partition, and then you can use whatever tool you want to copy data from that snapshot to the backup partition. The important benefit of the snapshot is that it gives you a consistent, frozen-in-time picture of what the partition was, even though files on the real partition are constantly changing. I use dump/restore to copy everything. I suppose you could use rsync too, although I don't know how well that would do with everything in /dev. >Snapshots do interest me for other reasons and might you be >able to refer me to more about them? I only see the mksnap_ffs >man page. Presumably it can rollback in some way? No, no rollback. That *could* be implemented, but no one has done it yet. (I talked to Kirk about it once, and at one time I even had a student who claimed they would work on it for me, but so far nothing's happened...). I think there's a writeup somewhere on making/using snapshots. I'll see if I can remember where it is. Since there is no rollback, I use dump/restore to duplicate the snapshot on some other partition. I can then use *that* partition to boot up the system, if I need to. >>This gives me a nice backup of /boot, /root, and /etc. > >How are you handling /usr? I don't. If I can boot up a known-good backup kernel, and I have a known-good /bin and /sbin to match it, then I've been able to dig myself out of most troubles that I get myself into. YMMV. Er, by "I don't", I mean I rarely make a special backup of it before installing. But if I *do* have to boot into using the backup copy of '/', then that will mount the same /usr which the standard '/' would use. So, I'll have the "updated" /usr, along with the "back-level" '/', '/sbin', '/bin'. This can get you into trouble if you don't know what you're doing. But it is a much better starting point than if you didn't have any bootable backup partition at all... >>I then upgrade the running system. It >>seems to work fine for me. > >Thus giving you a system to roll back to if things go wrong? Correct. >How are you choosing between the roots? nextboot? The >bootmanager? I type commands into the boot loader. Note that I'm not doing remote-installs, so I'm able to type at the console when the system boots up. >>The one trick involved is that you duplicate '/' to '/xRoot', >>and then you have to remember to change '/xRoot/etc/fstab' so >>that it points to itself as the '/' partition... I do that >>in a script, so that change is handled automatically... > >That answers one of my questions above. As I prefaced, there >are many things to keep track of to make this work. > >Considering the big picture... do you feel you've eliminated >the risks involved with updating over ssh? No. I don't do remote installs. I'm just trying to deal with the dangers of constantly running the -current branch. And strange as it may seem, I have occasionally written my own kernel changes which have had a few bugs in them... >In my research the recently introduced /boot >directory/partition may provide some help. I do not think it will help you with what you're hoping for. /boot is a separate directory now (and that *is* a good change) but it will not work as a separate partition. >On that note, have you ever tried binary updates? No. I'm a systems-programmer, so I do want to do all my own builds, so I can try my own coding-changes, etc. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA