Drive labelling with ZFS - is this even a good idea?

Frank Leonhardt frank2 at fjl.co.uk
Wed Jun 14 14:22:14 UTC 2017


On 14/06/2017 03:02, David Christensen wrote:
> On 06/13/2017 04:32 PM, David Christensen wrote:
>> 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"
>
> Beware that all your disks need to have GPT labels, and those labels 
> need to be carried forward into /etc/fstab, etc., before you reboot, 
> as the kernel won't be able to find the disks using Disk ID or GPT 
> GUID labels once those methods are disabled.
>
>

Hi David,

It turns out that these options were set anyway. The problem turned out 
be be that I was assuming that geom label played nice with GPT. It 
doesn't! Well it does display labels set on GPT partitions, but it 
doesn't change them. It took a look at the GPT blocks to confirm this. 
It does, however, mask the GPT version with its own, sometimes, leading 
to much monkeyhouse.

So ignore glabel completely and set the labels using gpart instead.

Having got this sorted out, it turns out that it's really not as useful 
as it sounds. On a new array you can find a broken drive this way, but 
when it comes to moving a drive around (e.g. from the spare slot to its 
correct location) life isn't so simple. First off, ZFS does a good job 
of locating pool components wherever in the array you move them using 
the GUID. However, if you change the GPT label and move it, ZFS will 
refer to it by the device name instead. Nothing I have tried will 
persuade it otherwise. If you leave the label intact it's now pointing 
to the wrong slot, which ZFS really doesn't mind about but this could 
really ruin your day if you don't know.

Now FreeBSD 11.0 can flash the ident light on any drive you choose, by 
device name (as used by ZFS), I'm seriously wondering if labels are 
worth the bother if they can't be relied on. Consider what happen if a 
tech pulls two drives and puts them back in the wrong order. ZFS will 
carry on regardless, but the label will now identify the wrong slot. 
Dangerous!

Anyone got any thoughts on this?

Regards, Frank.




More information about the freebsd-questions mailing list