From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 13 16:40:24 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C635D16A4CE for ; Thu, 13 Jan 2005 16:40:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D75343D49 for ; Thu, 13 Jan 2005 16:40:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j0DGeObJ091885 for ; Thu, 13 Jan 2005 16:40:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j0DGeOUD091883; Thu, 13 Jan 2005 16:40:24 GMT (envelope-from gnats) Resent-Date: Thu, 13 Jan 2005 16:40:24 GMT Resent-Message-Id: <200501131640.j0DGeOUD091883@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Cyril Vechera Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C53F416A4CE for ; Thu, 13 Jan 2005 16:39:28 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9496C43D45 for ; Thu, 13 Jan 2005 16:39:28 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0DGdSpi025064 for ; Thu, 13 Jan 2005 16:39:28 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j0DGdS3f025063; Thu, 13 Jan 2005 16:39:28 GMT (envelope-from nobody) Message-Id: <200501131639.j0DGdS3f025063@www.freebsd.org> Date: Thu, 13 Jan 2005 16:39:28 GMT From: Cyril Vechera To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: misc/76209: geom metadata/label ambiguity with last slices - mirror, label etc X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2005 16:40:25 -0000 >Number: 76209 >Category: misc >Synopsis: geom metadata/label ambiguity with last slices - mirror, label etc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 13 16:40:24 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Cyril Vechera >Release: 5.3 >Organization: Net Ltd. >Environment: FreeBSD 2.tester.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Thu Jan 13 15:35:36 UTC 2005 root@tester.local:/usr/obj/usr/src/sys/GENERIC i386 >Description: When geom based subsystems writes metadata on a hard disk there is possible ambiguity with nested slices. Becouse of geom label is stored in the last sector of provider's slice, it can beloing to either parent or child slice, for example to ad0 and ad0s4 and ad0s4h. This ambiguity can result a problems with geom system configuration, rebuilding and data loss. >How-To-Repeat: 2# disklabel ad1s2 # /dev/ad1s2: 8 partitions: # size offset fstype [fsize bsize bps/cpg] c: 480008592 0 unused 0 0 # "raw" part, don't edit e: 134217728 0 unused 0 0 f: 345790864 134217728 unused 0 0 2# gmirror label block1 ad1s2e 2# gmirror label block2 ad1s2f 2# gmirror list Geom name: block2 State: COMPLETE Components: 1 Balance: split Slice: 4096 Flags: NONE SyncID: 1 ID: 4101347184 Providers: 1. Name: mirror/block2 Mediasize: 177044921856 (165G) Sectorsize: 512 Mode: r0w0e4 Consumers: 1. Name: ad1 Mediasize: 250059350016 (233G) Sectorsize: 512 Mode: r0w0e6 State: ACTIVE Priority: 0 Flags: NONE SyncID: 1 ID: 637386526 Geom name: block2.sync Geom name: block1 State: COMPLETE Components: 1 Balance: split Slice: 4096 Flags: NONE SyncID: 1 ID: 1722957731 Providers: 1. Name: mirror/block1 Mediasize: 68719476224 (64G) Sectorsize: 512 Mode: r0w0e0 Consumers: 1. Name: mirror/block2s2e Mediasize: 68719476736 (64G) Sectorsize: 512 Mode: r0w0e0 State: ACTIVE Priority: 0 Flags: NONE SyncID: 1 ID: 4201844369 Geom name: block1.sync We have mirror/block2 thinking that his consumer is ad1 instead of ad1s2f >Fix: Maybe we have to store a name of provider as a hint in a label written on a disk. Quick workaround to avoid the problem is to shrink last nested slice on 1 sector to make different the last sector of a "geomed" slice and last sector of parent slice. >Release-Note: >Audit-Trail: >Unformatted: