From owner-freebsd-fs@FreeBSD.ORG Sat Jan 12 20:00:49 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 3F1B5130 for ; Sat, 12 Jan 2013 20:00:49 +0000 (UTC) (envelope-from freebsd@psconsult.nl) Received: from mx1.psconsult.nl (unknown [IPv6:2001:7b8:30f:e0::5059:ee8a]) by mx1.freebsd.org (Postfix) with ESMTP id DE7EA7AF for ; Sat, 12 Jan 2013 20:00:48 +0000 (UTC) Received: from mx1.psconsult.nl (mx1.hvnu.psconsult.nl [46.44.189.154]) by mx1.psconsult.nl (8.14.5/8.14.4) with ESMTP id r0CK0ffe078184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 12 Jan 2013 21:00:46 +0100 (CET) (envelope-from freebsd@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.5/8.14.4/Submit) id r0CK0faH078183 for freebsd-fs@freebsd.org; Sat, 12 Jan 2013 21:00:41 +0100 (CET) (envelope-from freebsd@psconsult.nl) X-Authentication-Warning: mx1.psconsult.nl: paul set sender to freebsd@psconsult.nl using -f Date: Sat, 12 Jan 2013 21:00:41 +0100 From: Paul Schenkeveld To: freebsd-fs@freebsd.org Subject: Re: Using glabel Message-ID: <20130112200041.GA77338@psconsult.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 20:00:49 -0000 On Fri, Jan 11, 2013 at 09:13:33PM -0800, Tim Gustafson wrote: > Hi, > > 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. > > So, my thinking was along the lines of: > > - 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 > - snip 43 more glabel lines > - zpool import tank -d /dev/gptid > > Is there any reason that this is a bad idea? Do I have the command > sequence correct? Using labels instead of auto-enumerated names (ada0, ada1 ...) is generally a good idea I think and makes sysadmin life a bit easier. You can use glabel to label your disks or partition the disks with gpart (using the GPT scheme) and let gpt put a label on each (-l flag). In the past I always used glabel for that but since I had disks fail on me and found out that a replacement disk of the same capacity was actually several sectors smaller than the original, I changed to using gpart and allocate all but the few last MB of every disk so that if I have to replace a broken disk by one which is a bit smaller it won't give a problem. Labels created using the -l option of gpart appear in /dev/gpt instead of /dev/label but that should be no problem. ZFS finds the labelled partitions first, even without using the -d flag. HTH Paul Schenkeveld