From owner-freebsd-questions@freebsd.org Tue Jun 13 23:32:58 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 021E8C093D3 for ; Tue, 13 Jun 2017 23:32:58 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "holgerdanske.com", Issuer "holgerdanske.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E6373709BA for ; Tue, 13 Jun 2017 23:32:57 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from 99.100.19.101 ([99.100.19.101]) by holgerdanske.com with ESMTPSA (ECDHE-RSA-AES128-GCM-SHA256:TLSv1.2:Kx=ECDH:Au=RSA:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Tue, 13 Jun 2017 16:32:51 -0700 Subject: Re: Drive labelling with ZFS To: freebsd-questions@freebsd.org References: <03643051-38e8-87ef-64ee-5284e2567cb8@fjl.co.uk> From: David Christensen Message-ID: Date: Tue, 13 Jun 2017 16:32:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <03643051-38e8-87ef-64ee-5284e2567cb8@fjl.co.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jun 2017 23:32:58 -0000 On 06/13/2017 02:52 PM, Frank Leonhardt wrote: > Can anyone help me? I'm going quietly crazy here with FreeBSD 11-RELEASE > > If you're creating a non-trivial ZFS raidz zpool, I've heard it said > that labelling the GPT partitioned drives with their shelf and row > number is A Good Thing. (I'm not talking about sticky labels stuck on > the drive, but they're good too). When you look at a healthy zpool > status you get a list of all the GEOMs, but when one fails it's > identified by the GUID and not the device. Good luck tracking it down > from that piece of information, unless it's also making a strange > buzzing noise. > > So I though I'd just use use glabel label to set a label on the vdev > (e.g "/dev/da7p3") and zpool would use that instead. Nope; only the > GUID. I also, naively, thought that setting the label would cause it to > appear as a device in /dev/gpt/ > > What have I not understood? > > I have a theory - label the partitions before creating the zpool, and > add them to the zpool afterwas by a /dev/gpt/ name. Except I have lost > confidence that the label would appear in /dev/gpt/. It could be that > /dev/gpt names don't appear if they're part of a zpool. > > However, testing this theory is going to involve hassle (i.e. the > destruction and rebuilding of the entire zpool) so if anyone could tell > me if I'm heading in the right direction I'd appreciate it. I may well > have missed something trivial here. > > Thanks, Frank. [1] pp. 30-35 and [3] pp. 4-8 discuss various choices for labels, and recommend meaningful GPT label strings set manually by the administrator. For example, [3] p. 6: # gpart add -t freebsd-zfs -l zfs-mirror-1 da2 If you've used GPT partitioning on the drives in your zpool, it might be possible to add GPT labels now. For example, [3] p. 6: # gpart modify -i 2 -l f01-serialnum da2 Both [1] and [3] discuss the fact that a given drive, partition, file system, etc., can be identified in various ways, manual or automatic, but the kernel will pick one and "wither" the rest. Once a GPT label is set manually, other methods should be disabled via settings in /boot/loader.conf and the system rebooted ([1] p. 35): kern.geom.label.disk_ident.enable="0" kern.geom.label.gptid.enable="0" I'd suggest experimenting with USB flash drives on another machine. David [1] Michael W. Lucas, 2014, "FreeBSD Mastery: Storage Essentials", https://www.michaelwlucas.com/os/fmse [2] Michael W. Lucas & Allan Jude, 2015, "FreeBSD Mastery: ZFS", https://www.michaelwlucas.com/os/fmzfs [3] Allan Jude & Michael W. Lucas, 2015, "FreeBSD Mastery: Advanced ZFS", https://www.michaelwlucas.com/os/fmaz