From owner-freebsd-questions@FreeBSD.ORG Fri Jul 3 22:26:06 2009 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 4FD4F1065670; Fri, 3 Jul 2009 22:26:06 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 015438FC14; Fri, 3 Jul 2009 22:26:05 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from isis.bris.ac.uk ([137.222.10.63]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1MMrCj-0004Sn-AT; Fri, 03 Jul 2009 23:26:04 +0100 Received: from mech-cluster238.men.bris.ac.uk ([137.222.187.238]) by isis.bris.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1MMrCh-000309-PV; Fri, 03 Jul 2009 23:26:00 +0100 Received: from mech-cluster238.men.bris.ac.uk (localhost.men.bris.ac.uk [127.0.0.1]) by mech-cluster238.men.bris.ac.uk (8.14.3/8.14.3) with ESMTP id n63MPxw2032504; Fri, 3 Jul 2009 23:25:59 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster238.men.bris.ac.uk (8.14.3/8.14.3/Submit) id n63MPwkL032501; Fri, 3 Jul 2009 23:25:58 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster238.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Fri, 3 Jul 2009 23:25:58 +0100 From: Anton Shterenlikht To: Alban Hertroys Message-ID: <20090703222558.GA32365@mech-cluster238.men.bris.ac.uk> References: <20090625110253.GA31443@mech-cluster238.men.bris.ac.uk> <10FCC74D-6D46-4112-AD89-BBB4C5933957@mac.com> <20090701105649.GA62596@mech-cluster238.men.bris.ac.uk> <20090702083709.GA66827@mech-cluster238.men.bris.ac.uk> <20090703101242.GA59906@mech-cluster238.men.bris.ac.uk> <1944CCC8-B2D5-4C06-B21C-FAA5A37D6EE1@solfertje.student.utwente.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1944CCC8-B2D5-4C06-B21C-FAA5A37D6EE1@solfertje.student.utwente.nl> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Score: -1.2 X-Spam-Level: - X-Mailman-Approved-At: Sat, 04 Jul 2009 01:00:48 +0000 Cc: Marcel Moolenaar , freebsd-current@freebsd.org, Wojciech Puchar , Anton Shterenlikht , freebsd-questions@freebsd.org, freebsd-ia64@freebsd.org Subject: SUCCESS: Re: gmirror per partition 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, 03 Jul 2009 22:26:06 -0000 On Fri, Jul 03, 2009 at 01:18:28PM +0200, Alban Hertroys wrote: > On Jul 3, 2009, at 12:12 PM, Anton Shterenlikht wrote: > > > now to mirror root partition. > > > > My problem is that root is mounted and cannot (?) be unmounted, > > unlike /efi, > > on the live system. > > > > # gpart add -b 819234 -s 1048576 -t freebsd-ufs da1 > > da1p2 added > > # > > > > # gmirror label -vb round-robin root /dev/da0p2 > > gmirror: Can't store metadata on /dev/da0p2: Operation not permitted. > > # > > > > If I create gmirror on da1, the spare disk: > > > > # gmirror label -vb round-robin root /dev/da1p2 > > Metadata value stored on /dev/da0p1. > > Done. > > # > > > > so that > > > > # gmirror status > > Name Status Components > > mirror/efi COMPLETE da0p1 > > da1p1 > > mirror/root COMPLETE da1p2 > > > > # > > > > > > then I still cannot insert da0p2 > > > > > > # gmirror insert root da0p2 > > gmirror: Cannot access provider da0p2. > > # > > > > So how can I gmirror root partion on a live system? > > You're almost there... I did this a while ago, can't remember when, > but I just upgraded the system that had this from FreeBSD 6.3 of > sometime in 2006 to 7.2. > > What I believe I did from this point on was: > > Copy everything from the root partition to mirror/root. > Modify /etc/fstab to mount root on mirror/root. > Reboot. > > Now the original root partition isn't mounted anymore, so we can do > operate on it's geom stuff. > > gmirror insert root da0p2 > > That should be it. > If that doesn't work you can always boot off a live file-system CD/DVD > and perform these actions from there. You won't have man pages in that > case though, or at least I couldn't find a way to read them off the > DVD last I tried. > > One thing I'd like to warn about at this point: > If you ever upgrade to a kernel with a newer geom metadata version and > that new kernel crashes, you're left with a system where the new > kernel can't boot at all while the old kernel can't mount the root > mirror as it's now of a version it can't handle. > You can however mount a single geom provider of that root file system > (/dev/da1p2 for example) to try to fix things. > That file-system WILL be dirty, but DON'T run fsck on it or you will > destroy it's contents. That's what happened to my upgrade above... > > Thankfully it was only my root partition with hardly any data on it > and I did make level 0 dumps before the upgrade, but I needed to > restore that FS from a fixit shell without man pages. Augh! thank you, that was helpful. I think I've got it, but it's a bit more complex on ia64 because /boot is a symlink to /efi/boot, which is a separate partition. Anyway, I've got: # gmirror status Name Status Components mirror/efi COMPLETE da0p1 da1p1 mirror/root COMPLETE da0p2 da1p2 mirror/swap COMPLETE da0p3 da1p3 mirror/var COMPLETE da1p4 da0p4 mirror/tmp COMPLETE da1p5 da0p5 mirror/usr DEGRADED da1p6 da0p6 (24%) # I'll try to write up my experience and post later. thanks again -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 928 8233 Fax: +44 (0)117 929 4423