Date: Wed, 1 Jul 2009 09:38:32 -0500 From: "Rick C. Petty" <rick-freebsd2008@kiwi-computer.com> To: Marcel Moolenaar <xcllnt@mac.com> Cc: Ivan Voras <ivoras@freebsd.org>, freebsd-geom@freebsd.org Subject: Re: gmirror gm0 destroyed on shutdown; GPT corrupt Message-ID: <20090701143832.GA41858@keira.kiwi-computer.com> In-Reply-To: <06F4B172-3A59-49EA-A271-CCFC74B2B52A@mac.com> References: <20090625110253.GA31443@mech-cluster238.men.bris.ac.uk> <10FCC74D-6D46-4112-AD89-BBB4C5933957@mac.com> <h24v15$70v$1@ger.gmane.org> <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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090701143832.GA41858>