From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 7 00:10:11 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E98671065674 for ; Mon, 7 Nov 2011 00:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C749D8FC0C for ; Mon, 7 Nov 2011 00:10:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA70AAFw029477 for ; Mon, 7 Nov 2011 00:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA70AAd8029475; Mon, 7 Nov 2011 00:10:10 GMT (envelope-from gnats) Resent-Date: Mon, 7 Nov 2011 00:10:10 GMT Resent-Message-Id: <201111070010.pA70AAd8029475@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, Jeff Lawson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78B3810656A5 for ; Mon, 7 Nov 2011 00:09:34 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 4A5838FC24 for ; Mon, 7 Nov 2011 00:09:34 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pA709Y3Q075273 for ; Mon, 7 Nov 2011 00:09:34 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id pA709XKM075272; Mon, 7 Nov 2011 00:09:33 GMT (envelope-from nobody) Message-Id: <201111070009.pA709XKM075272@red.freebsd.org> Date: Mon, 7 Nov 2011 00:09:33 GMT From: Jeff Lawson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/162342: FreeBSD hides gpt labels after mounting ZFS partitions X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 00:10:11 -0000 >Number: 162342 >Category: kern >Synopsis: FreeBSD hides gpt labels after mounting ZFS partitions >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 07 00:10:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Jeff Lawson >Release: 8.2-RELEASE-p2 >Organization: >Environment: FreeBSD mfsbsd 8.2-RELEASE-p2 FreeBSD 8.2-RELEASE-p2 #3 r222557M: Thu Jun 16 23:58:02 CEST 2011 root@neo.vx.sk:/usr/obj/releng_8_2/sys/GENERIC amd64 >Description: If you use "gpart" to create a GPT disk with partitions that have gpt labels defined, then those labels are normally visible in /dev/gpt/ However, once any of those partitions are used by a ZFS pool that is imported, the label disappears from /dev/gpt/ After you stop using that ZFS pool with "zpool export", the missing labels do not reappear in /dev/gpt/ until you reboot. The GUID entries in /dev/gptid/ are fine and do not disappear after importing the ZFS pool. This forum thread from 5 months ago is about another user that has experienced similar frustration by this problem. (He ended up with a workaround of using the older style "glabel" which creates labels under /dev/label instead of relying on the GPT-specific labels): http://forums.freebsd.org/showthread.php?t=24695 >How-To-Repeat: The tutorial at this wiki page describes using "gpart add -l" to define labels and create an environment that replicates this problem: http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror In particular, this command will create a GPT partition with a label: Fixit# gpart add -s 60G -t freebsd-zfs -l disk0 ad0 Here is some actual output from my own system: mfsbsd# ls -l /dev/gpt total 0 crw-r----- 1 root operator 0, 87 Nov 6 17:50 data0 crw-r----- 1 root operator 0, 94 Nov 6 17:50 data1 crw-r----- 1 root operator 0, 89 Nov 6 17:50 swap0 crw-r----- 1 root operator 0, 92 Nov 6 17:50 swap1 (labels are present, as they should be) mfsbsd# mkdir /zroot mfsbsd# zpool import -R /zroot zroot mfsbsd# ls -l /dev/gpt total 0 crw-r----- 1 root operator 0, 89 Nov 6 17:50 swap0 crw-r----- 1 root operator 0, 92 Nov 6 17:50 swap1 (labels have disappeared after importing the ZFS pool) mfsbsd# uname -a FreeBSD mfsbsd 8.2-RELEASE-p2 FreeBSD 8.2-RELEASE-p2 #3 r222557M: Thu Jun 16 23:58:02 CEST 2011 root@neo.vx.sk:/usr/obj/releng_8_2/sys/GENERIC amd64 mfsbsd# mfsbsd# gpart list | egrep 'Name|label' 1. Name: ad2p1 label: (null) 2. Name: ad2p2 label: data0 <---- 3. Name: ad2p3 label: swap0 1. Name: ad2 1. Name: ad3p1 label: (null) 2. Name: ad3p2 label: data1 <---- 3. Name: ad3p3 label: (null) 1. Name: ad3 >Fix: >Release-Note: >Audit-Trail: >Unformatted: