From owner-freebsd-questions@FreeBSD.ORG Sat Oct 27 21:42:12 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82263467 for ; Sat, 27 Oct 2012 21:42:12 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADE48FC0C for ; Sat, 27 Oct 2012 21:42:12 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q9RLgBwe070095; Sat, 27 Oct 2012 15:42:11 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q9RLgBu1070092; Sat, 27 Oct 2012 15:42:11 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sat, 27 Oct 2012 15:42:11 -0600 (MDT) From: Warren Block To: freebsd@johnea.net Subject: Re: 9.1 and gmirror with GPT? In-Reply-To: <508C2043.8070205@johnea.net> Message-ID: References: <5082EAEE.4040609@johnea.net> <50833F78.1060609@bnrlabs.com> <5085C743.8000508@johnea.net> <5086C7EB.9020104@johnea.net> <508C2043.8070205@johnea.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Sat, 27 Oct 2012 15:42:11 -0600 (MDT) Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 21:42:12 -0000 On Sat, 27 Oct 2012, freebsd@johnea.net wrote: > On 2012-10-23 17:46, Warren Block wrote: >> On Tue, 23 Oct 2012, freebsd@johnea.net wrote: > >>> To create a swap and then a root that fills the rest of the disk, must the swap be created first, like this: >>> >>> gpart add -t freebsd-swap -a 4k -s 4g mirror/gm0s1 >>> gpart add -t freebsd-ufs -a 4k mirror/gm0s1 >>> >>> Is there any other way to tell gpart to create the / partition using all space except 4G? >> >> I'm afraid it requires one to Use Math(tm). gpart show will at least show the real capacity of a drive, instead of the diagonally-measured inflated units used by drive vendors. > > Thanks for your guidance Warren! I've also been reading a number of threads on the forums on this subject, to which you contributed. > > Rather than face the scary prospect of using actual Math(tm) 8-) I was just going to create swap first at 8G, and let the freebsd partition fill the rest of the disk, however as I try to destroy previous non-aligned MBR and gmirror metadata, I'm running into issues: > > "mirror/gm0s1 added, but partition is not aligned on 4096 bytes" > > Below is a short screen shot of the commands used to destroy and then recreate gmirror. I'm currently running with non-geom ada0 as root, and am attempting to create the aligned partitions of gm0 on ada1. > > I'm not sure what to do to cause the MBR scheme to be aligned. Thanks for any feedback! > > johnea > > orsbackup# mount > /dev/ada0s1a on / (ufs, local, journaled soft-updates) > devfs on /dev (devfs, local, multilabel) > orsbackup# gmirror status > Name Status Components > mirror/gm0 COMPLETE ada1 (ACTIVE) > orsbackup# gpart destroy -F mirror/gm0 > mirror/gm0 destroyed > orsbackup# gpart create -s MBR mirror/gm0 > mirror/gm0 created > orsbackup# ls /dev/mirror/ > gm0 > orsbackup# gpart add -t freebsd -a 4k mirror/gm0 > mirror/gm0s1 added, but partition is not aligned on 4096 bytes This is new to me, I have not seen it before. I had the impression that gpart put the bsdlabel partition table at a misaligned offset so that the actual filesystems in those partitions would land on an aligned block, but it never gave that message. That comes from sys/geom/part/g_part.c, function g_part_ctl_add which starts at line 645: 743 /* Provide feedback if so requested. */ 744 if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { 745 sb = sbuf_new_auto(); 746 G_PART_FULLNAME(table, entry, sb, gp->name); 747 if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0) 748 sbuf_printf(sb, " added, but partition is not " 749 "aligned on %u bytes\n", pp->stripesize); 750 else 751 sbuf_cat(sb, " added\n"); 752 sbuf_finish(sb); 753 gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); 754 sbuf_delete(sb); 755 } 756 return (0); > orsbackup# gpart show > => 63 3907029105 ada0 MBR (1.8T) > 63 63 - free - (31k) > 126 3906994077 1 freebsd [active] (1.8T) > 3906994203 34965 - free - (17M) > > => 0 3906994077 ada0s1 BSD (1.8T) > 0 3890216960 1 freebsd-ufs (1.8T) > 3890216960 16777116 2 freebsd-swap (8G) > 3906994076 1 - free - (512B) > > => 63 3907029104 mirror/gm0 MBR (1.8T) > 63 63 - free - (31k) > 126 3907028979 1 freebsd (1.8T) > 3907029105 62 - free - (31k) > > => 0 3907028979 mirror/gm0s1 BSD (1.8T) > 0 3890216960 1 freebsd-ufs (1.8T) > 3890216960 16777116 2 freebsd-swap (8G) > 3906994076 34903 - free - (17M)