From owner-freebsd-fs@FreeBSD.ORG Sun Jan 1 22:04:17 2012 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 8BE9B106564A for ; Sun, 1 Jan 2012 22:04:17 +0000 (UTC) (envelope-from fbsd@dannysplace.net) Received: from mailgw.dannysplace.net (mailgw.dannysplace.net [204.109.56.184]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5E68FC13 for ; Sun, 1 Jan 2012 22:04:16 +0000 (UTC) Received: from [203.206.171.212] (helo=[192.168.10.12]) by mailgw.dannysplace.net with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RhTWe-0004bk-QB; Mon, 02 Jan 2012 08:05:11 +1000 Message-ID: <4F00D853.5010607@dannysplace.net> Date: Mon, 02 Jan 2012 08:04:03 +1000 From: Dan Carroll User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Freddie Cash References: <4F003EB8.6080006@dannysplace.net> <4F00522F.6020700@dannysplace.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-User: danny X-Authenticator: plain X-Exim-Version: 4.76 (build at 08-Jun-2011 18:40:49) X-Date: 2012-01-02 08:05:09 X-Connected-IP: 203.206.171.212:63328 X-Message-Linecount: 110 X-Body-Linecount: 97 X-Message-Size: 4916 X-Body-Size: 4192 X-Received-Count: 1 X-Recipient-Count: 2 X-Local-Recipient-Count: 2 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 X-SA-Exim-Connect-IP: 203.206.171.212 X-SA-Exim-Mail-From: fbsd@dannysplace.net X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on damka.dannysplace.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mailgw.dannysplace.net) Cc: freebsd-fs@freebsd.org Subject: Re: ZFS With Gpart partitions 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: Sun, 01 Jan 2012 22:04:17 -0000 On 1/01/2012 10:45 PM, Freddie Cash wrote: > On Sun, Jan 1, 2012 at 4:31 AM, Dan Carroll wrote: >> >> Ok, so the label is still there. Two things are still strange. >> 1) data2 is not in /dev/gpt/ >> 2) "glabel list da8p1" does not find anything. But it does for other >> drives. > > You may need to offline the disk in the zfs pool, then "gpart destroy > da8" to clear out the primary GPT table at the start of the disk, and > the secondary GPT table at the end of the disk. That will also clear > out the /dev/da8p* entries, and related /dev/gpt/ entry. > > Then create the GPT from scratch, including the label. > > Then, finally, add/replace the disk to the ZFS pool. > > The [kernel|GEOM|whatever] doesn't do a very good job of re-checking > the disks for changed GPT tables, instead using the ones in memory. > Or something along those lines. You have to destroy the existing > table, then create it, which causes the [kernel|GEOM|whatever] to > re-taste the disk and load the GPT off the disk, thus creating the > /dev/gpt/ entry. Thanks for your reply. It's quite informative. Reading a little more I see that the label stuff is written to the end of the disk. Here is what I think happened. 1) I inserted a disk with a label that already existed. The kernel decided to simply remove the device entry from /dev/gpt (data2) and so ZFS found it's data on the GPT partition (rather than the label that points to the partition). 2) I wiped the new disk on a second system, but actually I didn't wipe the GPT label at the end until I re-did the GPT partition. 3) Re-inserted new disk and resilvered. All good but ZFS now knows the old disk via the GPT partition. I'm still confused as to why "glabel list da8p1" does not work. Perhaps all that command does is: scan the device for a label (it would find data2) and then check what data2 is in /dev/gpt? I guess another way might be to bring down the server, take the disk out, re-do the GPT stuff on another machine, and then put it back. That way ZFS may well simpy see it's data on the labeled device. Oh wait, that wont create the /dev/gpt entries... :-( I'd really like to fix this but avoid doing *another* resilver. The first one is finished now and a scrub operation will be done in an hour or so. I guess I should have the faith to do go ahead and do it again, but there is an element of risk, and it's to fix something cosmetic. That feels wrong... >> Also, is there a difference (for ZFS) acessing the drive via /dev/da8p1 or >> /dev/gpt/data2 > > As far as ZFS is concerned, no. When importing the pool, ZFS checks > for ZFS metadata to determine which disk belongs to which vdev in > which pool, and gets all the pathing sorted out automatically. > > However, since disk device nodes can change at boot (add a new > controller, boot with a dead drive, do a BIOS update that reverses the > PCI scan order, etc), it makes it easier on the admin to have labels. Yeah I am aware of ZFS doing that. It's a nice feature. It's also the reason why in my system data2 is NOT da2p1. What I was trying to dertermine is if there is any danger to ZFS accessing the disk in this manner. Is da8p1 an identical device to data3? From what you describe, from ZFS' point of view, for each device in the pool, there are actually 2 versions of it. The dataX version, and the daXp1 version.. I am guessing that ZFS keeps track of the disk names in it's pools. Otherwise, what would stop this (the label being replaced with a device name in ZFS) happening between reboots? > > > For example, in our 16-bay storage servers, I've set up a coordinate > system where columns are letters A-D, and rows are numbers 1-4. Then > I've labelled each disk according to where it is in the chassis: > /dev/gpt/disk-a1 > /dev/gpt/disk-a2 > /dev/gpt/disk-a3 > /dev/gpt/disk-a4 > etc > > That way, no matter how the drives are actually enumerated by the > BIOS, loader, kernel, drivers, etc, I always know which disk is having > issues. :) > That was also my reasoning. My numbering starts disk0 being in the top left slot, and continues row by row. -D