From owner-freebsd-fs@FreeBSD.ORG Tue Nov 11 13:35:25 2008 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 EB8041065689; Tue, 11 Nov 2008 13:35:25 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D15EF8FC37; Tue, 11 Nov 2008 13:35:24 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA29352; Tue, 11 Nov 2008 15:35:23 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <49198A1A.3080600@icyb.net.ua> Date: Tue, 11 Nov 2008 15:35:22 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.17 (X11/20081106) MIME-Version: 1.0 To: freebsd-geom@freebsd.org, freebsd-fs@freebsd.org References: <4911C3E9.405@icyb.net.ua> In-Reply-To: <4911C3E9.405@icyb.net.ua> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: zfs: affected by geom_(mbr|bsd) => geom_part_(mbr|bsd) ? 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: Tue, 11 Nov 2008 13:35:26 -0000 on 05/11/2008 18:03 Andriy Gapon said the following: > Using GENERIC amd64 7-BETA2 system (installed from "official" ISO) I > partitioned my disk for ZFS root file system more or less as described here: > https://ish.com.au/solutions/articles/freebsdzfs > > Big difference is that I created a separate slice to contain a partition > for ZFS pool, so that ZFS pool is ad4s2d (and UFS2 boot is ad4s1a). > > Everything was fine, ZFS root was mounted as expected. > > Then I built a custom kernel with nooptions for GEOM_(BSD|MBR) and > options for GEOM_PART_(BSD|MBR). When I tried to boot this kernel it > couldn't mount ZFS root and I simply rebooted my machine when I stuck at > mountroot prompt (I couldn't enter UFS2 root because of unrelated > keyboard problem). > The boot was verbose and I didn't see any peculiar GEOM or GEOM_PART > messages (errors, warnings). > > I'll try to debug this further by booting into UFS root and running > gpart, but I'd like to ask for an advice upfront. So I did this. Here are some data: $ gpart show => 63 976773105 ad6 MBR (500.1GB) 63 12578832 1 freebsd [active] (6.4GB) 12578895 964189170 2 freebsd (493.7GB) 976768065 5103 - free - (2.6MB) => 0 12578832 ad6s1 BSD (6.4GB) 0 16 - free - (8.2KB) 16 2097152 1 freebsd-ufs (1073.7MB) 2097168 2097152 - free - (1073.7MB) 4194320 8384512 2 freebsd-swap (4.3GB) => 0 964189170 ad6s2 BSD (493.7GB) 0 16 - free - (8.2KB) 16 964189154 4 freebsd-swap (493.7GB) $ zpool status pool: tank state: UNAVAIL status: One or more devices could not be opened. There are insufficient replicas for the pool to continue functioning. action: Attach the missing device and online it using 'zpool online'. see: http://www.sun.com/msg/ZFS-8000-D3 scrub: none requested config: NAME STATE READ WRITE CKSUM tank UNAVAIL 0 0 0 insufficient replicas ad6s2d UNAVAIL 0 0 0 cannot open So gpart sees ad6s2d perfectly well, it has the same parameters as disklabel previously reported and /dev/ad6s2d exists. But zfs "cannot open" it. What I did next was: 1. reboot into "disklabel" kernel single-user 2. zpool export tank 3. reboot into gpart kernel single-user 4. zpool import - it saw tank correctly 5. zpool import tank 6. profit! :-) As I see it, zpool.cache contained something about ad6s2d that prevented gpart ad6s2d from being recognized as the same device as "disklabel" one. I really wonder what that could have been? Or maybe gpart reported some subtle property of the device differently... -- Andriy Gapon