From owner-freebsd-current@FreeBSD.ORG Sun Jun 14 00:37:26 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C8CF106564A for ; Sun, 14 Jun 2009 00:37:26 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout018.mac.com (asmtpout018.mac.com [17.148.16.93]) by mx1.freebsd.org (Postfix) with ESMTP id 18B7B8FC08 for ; Sun, 14 Jun 2009 00:37:26 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from MacBook-Pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp018.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KL7000JOAYD3R70@asmtp018.mac.com> for freebsd-current@FreeBSD.org; Sat, 13 Jun 2009 16:37:25 -0700 (PDT) Message-id: From: Marcel Moolenaar To: Alexander Best In-reply-to: Date: Sat, 13 Jun 2009 16:37:25 -0700 References: X-Mailer: Apple Mail (2.935.3) Cc: freebsd-current@FreeBSD.org Subject: Re: `gpart show` and secondary GPT header X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 00:37:26 -0000 On Jun 13, 2009, at 11:53 AM, Alexander Best wrote: > hi there, > > i already posted this message to freebsd-questions but didn't get > any reply. > that's why i'm sending it to freebsd-current. > > i have a question about gpart. when id do `gpart show ad0` i get the > following > output: > > => 34 488394988 ad0 GPT (233G) > 34 20971486 1 freebsd-swap (10G) > 20971520 467423502 2 freebsd-ufs (223G) > > which is just what i want. however i'm a bit curious about the GPT > header. > only the primary header from 0 - 33 is being shown. what about the > secondary/backup GPT header. is it present and just now shown by > gpart or > doesn't it exist at all? if it's just not shown it would be great if > gpart had > a verbose switch or something like that. gpart(8) does not show headers at all. The first line merely shows the first possible LBA that can be assigned to a partition and the amount of space that can be assigned (starting from the first LBA). This information also applies to any other scheme, eg: ns1% gpart show ad0 => 63 80293185 ad0 MBR (38G) 63 80292807 1 freebsd [active] (38G) 80292870 378 - free - (189K) ns1% gpart show ad0s1 => 0 80292807 ad0s1 BSD (38G) 0 2097152 1 freebsd-ufs (1.0G) 2097152 16777216 2 freebsd-swap (8.0G) 18874368 16777216 4 freebsd-ufs (8.0G) 35651584 44641223 5 freebsd-ufs (21G) Typically the sector before the first allocatable LBA and extending beyond the allocatable space are used for metadata (i.e. the GPT headers), but that may not be the case. In any case: the primary and secondary GPT headers and tables are in fact on the disk. They're there, trust me :-) > > because in 7-STABLE e.g. `pt show ad0` also displays the secondary > GPT header > at the end of the disk. gpart(8) is unlike gpt(8) in having in-depth knowledge of the on-disk representation. This is a deliberate abstraction. FYI, -- Marcel Moolenaar xcllnt@mac.com