From owner-freebsd-fs@FreeBSD.ORG Sat Jan 12 10:37:12 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E98D3A91 for ; Sat, 12 Jan 2013 10:37:12 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.31.97]) by mx1.freebsd.org (Postfix) with ESMTP id 74F1DF63 for ; Sat, 12 Jan 2013 10:37:12 +0000 (UTC) Received: from [84.44.211.82] (helo=fabiankeil.de) by smtprelay05.ispgateway.de with esmtpsa (SSLv3:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1TtyS1-0002ZF-O1; Sat, 12 Jan 2013 11:36:33 +0100 Date: Sat, 12 Jan 2013 11:36:22 +0100 From: Fabian Keil To: Tim Gustafson Subject: Re: Using glabel Message-ID: <20130112113622.0dbd6bc2@fabiankeil.de> In-Reply-To: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_//mYt88XJ07moyZVyLAUmetn"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: FreeBSD Filesystems X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 10:37:13 -0000 --Sig_//mYt88XJ07moyZVyLAUmetn Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Tim Gustafson wrote: > We have a few servers with 45 disks each. It gets a bit cumbersome at > the moment to map a failed drive (reported via "zpool status") to a > physical device. The physical devices are labeled with serial > numbers, and ZFS reports device nodes. I was wondering if I could use > "glabel" to label each of the disks we have with their serial number > to make identification easier, and then reconfigure the zpool to > import the drives by gptid, rather than device node. >=20 > So, my thinking was along the lines of: >=20 > - obtain the device serial numbers, probably using smartctl > - zpool export tank > - glabel -v SERIAL-NUMBER-0 /dev/ada0 > - glabel -v SERIAL-NUMBER-1 /dev/ada1 > - glabel -v SERIAL-NUMBER-2 /dev/ada2 The "label" action seems to be missing. > - snip 43 more glabel lines > - zpool import tank -d /dev/gptid For labels created with glabel this should be "-d /dev/label tank". /dev/gptid is for stuff created with gpart. > Is there any reason that this is a bad idea? Do I have the command > sequence correct? I'm using glabel for geli-encrypted backup pools to automate the import: http://www.fabiankeil.de/gehacktes/zogftw/ As it works for me, I don't think it's a bad idea in general, but note that glabel stores the label at the end of the device, slightly decreasing the space that is available for ZFS. In my tests ZFS never used the last sectors on a device (as far as I could tell) but I'm not sure if that's actually guaranteed. If the last sector on your disks is used by ZFS, creating a label with glabel on it would overwrite it and importing the pool using the label would additionally prevent ZFS from even accessing the sector. I believe you can test this by comparing the asize shown with zdb -l and comparing it with the size shown by diskinfo, but this relies on the asize count starting at the first sector and due to padding that might not be guaranteed either. Another problem that has been frequently reported is that importing the pool without specifying the /dev/label directory may let ZFS mix labeled devices and labels which renders the labeling somewhat pointless. Using geli prevents that of course, but using geli just to work around this is probably not something you want to do and also isn't an option for a "live migration". Fabian --Sig_//mYt88XJ07moyZVyLAUmetn Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDxPLIACgkQBYqIVf93VJ3VXwCfVSeb1kikeualj2b+s7WAWnyG 8lwAoKzV5PRKAQ9hPkizuWrLxguvZ8z+ =BRyX -----END PGP SIGNATURE----- --Sig_//mYt88XJ07moyZVyLAUmetn--