From owner-freebsd-fs@FreeBSD.ORG Thu Apr 1 19:40:34 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 719CC1065674 for ; Thu, 1 Apr 2010 19:40:34 +0000 (UTC) (envelope-from paul@fletchermoorland.co.uk) Received: from hydra.fletchermoorland.co.uk (hydra.fletchermoorland.co.uk [78.33.209.59]) by mx1.freebsd.org (Postfix) with ESMTP id F15CF8FC23 for ; Thu, 1 Apr 2010 19:40:33 +0000 (UTC) Received: from demophon.fletchermoorland.co.uk (demophon.fletchermoorland.co.uk [192.168.0.154]) by hydra.fletchermoorland.co.uk (8.14.3/8.14.3) with ESMTP id o31JA5K6097605; Thu, 1 Apr 2010 20:10:05 +0100 (BST) (envelope-from paul@fletchermoorland.co.uk) Message-ID: <4BB4EF8D.9090809@fletchermoorland.co.uk> Date: Thu, 01 Apr 2010 19:10:05 +0000 From: Paul Wootton User-Agent: Thunderbird 2.0.0.23 (X11/20091217) MIME-Version: 1.0 To: Bartosz Stec References: <4BB49E3F.7070506@it4pro.pl> In-Reply-To: <4BB49E3F.7070506@it4pro.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=4.5 required=10.0 tests=ALL_TRUSTED,BAYES_80, DNS_FROM_OPENWHOIS,FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hydra.fletchermoorland.co.uk Cc: freebsd-fs@freebsd.org, freebsd-current@freebsd.org Subject: Re: gpart failing with no such geom after gpt corruption X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 19:40:34 -0000 Bartosz, One thing to remember is that GPT stores it's header and entry tables at both the start and end of the disk for redundancy. As far as I understand it, by making the disk physically smaller, the GPT primary header and entry data would have become invalid as the last partition would now be ending past the end of the disk Partition table format Offset Length Content 0 8 Signature ("EFI PART", 45 46 49 20 50 41 52 54) ... 24 8 Current LBA (location of this header copy) 32 8 Backup LBA (location of the other header copy) 40 8 First usable LBA for partitions (primary partition table last LBA + 1) 48 8 Last usable LBA (secondary partition table first LBA - 1) ... GUID partition entry format Offset Length Content 0 16 Partition type GUID ... 32 8 First LBA (little-endian) 40 8 Last LBA (inclusive, usually odd) ... See http://en.wikipedia.org/wiki/GUID_Partition_Table