From owner-freebsd-stable@FreeBSD.ORG Thu Apr 28 16:32:17 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 257E21065741 for ; Thu, 28 Apr 2011 16:32:17 +0000 (UTC) (envelope-from petefrench@ingresso.co.uk) Received: from constantine.ingresso.co.uk (constantine.ingresso.co.uk [IPv6:2001:470:1f09:176e::3]) by mx1.freebsd.org (Postfix) with ESMTP id E11668FC22 for ; Thu, 28 Apr 2011 16:32:16 +0000 (UTC) Received: from dilbert.london-internal.ingresso.co.uk ([10.64.50.6] helo=dilbert.ingresso.co.uk) by constantine.ingresso.co.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.73 (FreeBSD)) (envelope-from ) id 1QFU8J-000Ej3-4v; Thu, 28 Apr 2011 17:32:03 +0100 Received: from petefrench by dilbert.ingresso.co.uk with local (Exim 4.74 (FreeBSD)) (envelope-from ) id 1QFU8J-000JnI-42; Thu, 28 Apr 2011 17:32:03 +0100 To: petefrench@ingresso.co.uk, tevans.uk@googlemail.com In-Reply-To: Message-Id: From: Pete French Date: Thu, 28 Apr 2011 17:32:03 +0100 Cc: freebsd-stable@freebsd.org Subject: Re: correct way to setup gmirror on 7.4? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2011 16:32:17 -0000 > Is this simple to do? When I setup my home ZFS server, I couldn't get > it to boot from ZFS, so I configured 2 disks as 'boot' discs: Its fairly simple - I generally dont boot from ZFs either, my standard config has a 4 gig UFS boot partition, and then a large zpool on the rest of the drive. usually I add in a bit of swap there, which I dnt mirror, so I get swap on each drive. So each disk looks like this with MBR da0s1 - 4 gig for / da0s2 - 2 gig for swap da0s3 - rest of drive for zpool because the gmirror is at the end of the partiton then the boot code finds the UFS filesystem at the start and boots from it not needing to know about gmirror. The gmirror is loaded in the boot process, and then mirrors the drive being booted with the other drive. I can boot of either drive and the system comes up fine. As for the zpool, well that sorts itself out fne, as ZFS is wont to do ;-) > => 34 2930277101 ada5 GPT (1.4T) > 34 128 1 (null) (64K) > 162 12582912 2 root (6.0G) > 12583074 2917694061 3 samsung15-1 (1.4T) > > The other 'boot' disc is configured the same, except it has > altroot/samsung15-2 labels on the UFS/ZFS GPT partitions (the other 4 > discs have a corresponding 6 GB partition for swap/dumps). > > However, this is as far as I got. I currently have > vfs.root.mountfrom="ufs:/dev/gpt/root", and I'd like to gmirror 'root' > onto 'altroot', without overwriting GPT labels or anything dangerous! I havent tried with GPT, but it should be the same as with MBR. Boot off the 1st drive, create a gmirror inside the root partition on the 2nd drive, newfs it and then cpdup the running system over to it. Make sure you do the necessaries on the 2nd drive to make it bootable as if you just had a standard UFS filesystem in that partition, with no gmirror. Now on te 2nd drive edit loader.conf so it looks something like this: geom_mirror_load="YES" vfs.root.mountfrom="ufs:/dev/mirror/mymirror" and fstab similarly: /dev/mirror/mymirror / ufs rw 2 2 Yu shuld now be able to boot from the 2nd drive fine. Check that works - it should come up OK, running wth your root on agmirror with a single element on that partition. At this point you can then add in the partition from the first disc to the mirror. Should now boot from either drive fine. as I said, I havent tried it with GPT, but there is no reason I can see that it wudnt work the same as with MBR. The only reason I still stick with MBR is that I like the FreeBSD boot loader which will let me choose F5 to select the next drive to boot from. Last time I looked there wasn't an exquivalent for GPT (if I missed this then I will now feel foolish...) cheers, -pete.