From owner-freebsd-current@FreeBSD.ORG Fri Jul 3 11:37:11 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B32E106566C for ; Fri, 3 Jul 2009 11:37:11 +0000 (UTC) (envelope-from dalroi@solfertje.student.utwente.nl) Received: from solfertje.student.utwente.nl (solfertje.student.utwente.nl [130.89.167.40]) by mx1.freebsd.org (Postfix) with ESMTP id 0410E8FC16 for ; Fri, 3 Jul 2009 11:37:10 +0000 (UTC) (envelope-from dalroi@solfertje.student.utwente.nl) Received: from localhost (localhost [127.0.0.1]) by solfertje.student.utwente.nl (Postfix) with SMTP id 17BE18061 for ; Fri, 3 Jul 2009 13:18:33 +0200 (CEST) Received: from hollewijn.internal (hollewijn.internal [10.236.150.4]) by solfertje.student.utwente.nl (Postfix) with ESMTP id 841F68053; Fri, 3 Jul 2009 13:18:28 +0200 (CEST) Message-Id: <1944CCC8-B2D5-4C06-B21C-FAA5A37D6EE1@solfertje.student.utwente.nl> From: Alban Hertroys To: Anton Shterenlikht In-Reply-To: <20090703101242.GA59906@mech-cluster238.men.bris.ac.uk> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Fri, 3 Jul 2009 13:18:28 +0200 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> X-Mailer: Apple Mail (2.935.3) X-DSPAM-Result: Innocent X-DSPAM-Processed: Fri Jul 3 13:18:33 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 909,4a4de909759157325793587 X-DSPAM-Factors: 27, many, 0.40000, but, 0.40000, but, 0.40000, That, 0.40000, That, 0.40000, From*Alban, 0.40000, shell, 0.40000, I+tried, 0.40000, partion, 0.40000, just, 0.40000, that+case, 0.40000, I'd+like, 0.40000, mount+the, 0.40000, system+>, 0.40000, still+cannot, 0.40000, from+a, 0.40000, can+always, 0.40000, Mime-Version*Message, 0.40000, geom+metadata, 0.40000, >+gmirror, 0.40000, >+gmirror, 0.40000, freebsd+current, 0.40000, "freebsd, 0.40000, or, 0.40000, or, 0.40000, 12+12, 0.40000, >+da1p2, 0.40000 Cc: freebsd-ia64@freebsd.org, Wojciech Puchar , Marcel Moolenaar , freebsd-questions@freebsd.org, freebsd-current@freebsd.org Subject: Re: gmirror per partition X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2009 11:37:12 -0000 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! > many thanks > > -- > 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 > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org > " > > > > Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll see there is no forest. !DSPAM:909,4a4de909759157325793587!