Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jan 2013 21:00:41 +0100
From:      Paul Schenkeveld <freebsd@psconsult.nl>
To:        freebsd-fs@freebsd.org
Subject:   Re: Using glabel
Message-ID:  <20130112200041.GA77338@psconsult.nl>
In-Reply-To: <CAG27QgTQFA2CvBSrH0Zid9oQg5RbmU55OvfP0njMoLpqHb_GTg@mail.gmail.com>
References:  <CAG27QgTQFA2CvBSrH0Zid9oQg5RbmU55OvfP0njMoLpqHb_GTg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130112200041.GA77338>