From owner-freebsd-arch@FreeBSD.ORG Thu Dec 4 21:24:38 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14D121065673; Thu, 4 Dec 2008 21:24:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 848328FC17; Thu, 4 Dec 2008 21:24:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mB4LOIOh033364; Thu, 4 Dec 2008 16:24:24 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Thu, 4 Dec 2008 13:13:34 -0500 User-Agent: KMail/1.9.7 References: <20081203.193714.693830802.imp@bsdimp.com> In-Reply-To: <20081203.193714.693830802.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812041313.34565.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Thu, 04 Dec 2008 16:24:29 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8721/Thu Dec 4 08:26:10 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: arch@freebsd.org, xcllnt@mac.com Subject: Re: RFC: making gpart default X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2008 21:24:38 -0000 On Wednesday 03 December 2008 09:37:14 pm M. Warner Losh wrote: > In message: > "Peter Wemm" writes: > : On Sat, Nov 29, 2008 at 7:30 PM, Marcel Moolenaar wrote: > : > > : > On Nov 29, 2008, at 1:56 PM, Peter Wemm wrote: > : [..] > : >> * There should be some guidance or hints on laying out disks. For > : >> example, a gpart create -s gpt on a raid volume ends up with a start > : >> sector of 34 for the free space. There should be a documentation hint > : >> to round up start sectors to a power of 2 and/or block size on a raid. > : >> eg: if you have a raid with 64K stripes, then move the start sector > : >> from 34 to 128. Otherwise we end up with file systems issuing > : >> transactions that can split across multiple raid stripes. FWIW, I > : >> conveniently filled this hole with boot code. > : > > : > Hmmm... gpart(8) typically can't store this kind > : > of information on-disk, but other than that it > : > supports alignment/padding already. We just need > : > a way to tell gpart about it. Maybe this should > : > come from the provider (i.e. underlying geom)... > : > : I was more thinking of a man page note to warn of the issue. > : > : Also, in the gpt case, it might make sense in gpt partition table case > : to round up the initial size to a power of 2. Right now we lose 34 > : sectors from the beginning. Rounding it to 64 total at least gets us > : to an even power of 2. UFS's frequent block size of 16K shouldn't > : cross any underlying stripe boundaries in the usual case. > > This likely is a hang over from the MBR code that puts the first > partition at one cylendar offset from the beginning to conform with > the MBR conventions of (some?) Bioses that use that to get the > parameters for the disk... No, the way GPT works, you have a PMBR at sector 0, then immediately following that you have the Primary partition table in the next N sectors (the first sector in the table has a header that contains the size of the table). Then you have a backup Secondary partition table in the last N sectors of the disk as well. At least with the old gpt(8) tool you could actually tell it how big of a table to make when you created a GPT, and I imagine gpart probably can do the same. -- John Baldwin