From owner-freebsd-geom@FreeBSD.ORG Wed Jul 1 14:38:33 2009 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2C131065679 for ; Wed, 1 Jul 2009 14:38:33 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from hamlet.setfilepointer.com (hamlet.SetFilePointer.com [63.224.10.2]) by mx1.freebsd.org (Postfix) with SMTP id 928698FC24 for ; Wed, 1 Jul 2009 14:38:33 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 25178 invoked from network); 1 Jul 2009 09:38:33 -0500 Received: from keira.kiwi-computer.com (HELO kiwi-computer.com) (63.224.10.3) by hamlet.setfilepointer.com with SMTP; 1 Jul 2009 09:38:33 -0500 Received: (qmail 41948 invoked by uid 2001); 1 Jul 2009 14:38:32 -0000 Date: Wed, 1 Jul 2009 09:38:32 -0500 From: "Rick C. Petty" To: Marcel Moolenaar Message-ID: <20090701143832.GA41858@keira.kiwi-computer.com> References: <20090625110253.GA31443@mech-cluster238.men.bris.ac.uk> <10FCC74D-6D46-4112-AD89-BBB4C5933957@mac.com> <2FFFB36F-EFA3-4D92-98A3-692BA2D6F63E@mac.com> <20090629210003.GA24038@keira.kiwi-computer.com> <704EE47D-F0C4-4C63-AA3C-3ADF92CC8379@mac.com> <20090630215345.GC33849@keira.kiwi-computer.com> <9bbcef730906301508l6f2ae344tff8f7495e870049e@mail.gmail.com> <20090630222540.GA34541@keira.kiwi-computer.com> <06F4B172-3A59-49EA-A271-CCFC74B2B52A@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06F4B172-3A59-49EA-A271-CCFC74B2B52A@mac.com> User-Agent: Mutt/1.4.2.3i Cc: Ivan Voras , freebsd-geom@freebsd.org Subject: Re: gmirror gm0 destroyed on shutdown; GPT corrupt X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd2008@kiwi-computer.com List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 14:38:34 -0000 On Tue, Jun 30, 2009 at 08:42:57PM -0700, Marcel Moolenaar wrote: > > On Jun 30, 2009, at 3:25 PM, Rick C. Petty wrote: > > > >According to wikipedia, the GPT header contains: > > - (offset 40) First usable LBA for partitions > > - (offset 48) Last usable LBA > > These do not represent the media size. They relate to > the region of the disk that can be assigned to partitions. According to wikipedia: "The values for current and backup LBAs of the primary header should be the second sector of the disk (1) and the last sector of the disk, respectively." And: offset contents ------ -------- 24 Current LBA (location of this header copy) 32 Backup LBA (location of the other header copy) 40 First usable LBA for partitions (primary partition table last LBA + 1) 48 Last usable LBA (secondary partition table first LBA - 1) So that the media is from relative LBA 0 (the protective MBR) to LBA N-1, the secondary GPT header, which is described in offset 32. Offset 48 should contain LBA N-2. Therefore the media size N is the value of offset 32 minus the value of offset 24, plus 1 (for the MBR). It seems pretty clear cut to me. -- Rick C. Petty