From owner-freebsd-geom@FreeBSD.ORG Sat Jun 27 11:16:06 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 A3BD11065670 for ; Sat, 27 Jun 2009 11:16:06 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5118FC1B for ; Sat, 27 Jun 2009 11:16:06 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MKVt4-00035n-V1 for freebsd-geom@freebsd.org; Sat, 27 Jun 2009 11:16:02 +0000 Received: from 93-138-112-207.adsl.net.t-com.hr ([93.138.112.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Jun 2009 11:16:02 +0000 Received: from ivoras by 93-138-112-207.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Jun 2009 11:16:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-geom@freebsd.org From: Ivan Voras Date: Sat, 27 Jun 2009 13:15:46 +0200 Lines: 30 Message-ID: References: <20090625110253.GA31443@mech-cluster238.men.bris.ac.uk> <10FCC74D-6D46-4112-AD89-BBB4C5933957@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 93-138-112-207.adsl.net.t-com.hr User-Agent: Thunderbird 2.0.0.21 (X11/20090612) In-Reply-To: <10FCC74D-6D46-4112-AD89-BBB4C5933957@mac.com> Sender: news Cc: freebsd-current@freebsd.org, freebsd-questions@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 List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2009 11:16:06 -0000 Marcel Moolenaar wrote: > > On Jun 25, 2009, at 4:02 AM, Anton Shterenlikht wrote: >> dev_taste(DEV,mirror/gm0) >> g_part_taste(PART,mirror/gm0) >> >> GEOM: mirror/gm0: the secondary GPT table is corrupt or invalid. >> GEOM: mirror/gm0: using the primary only -- recovery suggested. >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > You created the mirror after the GPT, which means you destroyed > the GPT backup header. gmirror uses the last sector on the disk > for metadata and that by itself is a cause for various problems. > > It's better to use gmirror per partition. Or create the GPT partition inside the gmirror device - then the GPT backup table will be at last_sector-1, but... > You could run into a race condition between GPT and gmirror and > GPT winning (again the result of gmirror using the last sector > on a disk for metadata). unfortunately this could still happen, and will lead to the same error if GPT is tasted first, since it is embedded in the first sector and will assume the whole drive is available to GPT, and will then proceed to not find its backup data in the last sector. It looks to me like GEOM classes should have a "priority" field for tasting. Any objections to that idea?