ZFS: zdev names don't match devices

Arthur Chance freebsd at qeng-ho.org
Sun Jul 12 12:33:55 UTC 2015


On 10/07/2015 22:48, Quartz wrote:
>> Did I screw
>> up my zfs setup?
>
> No. This is a quirk of the way the 10.x installer/ZFS works. There are a
> handful of different ways to identify a disk on FreeBSD besides the
> device ID, including UUIDs and gpt labels and such. Device IDs will
> change if you ever add/remove/reorder the physical drives, so the
> installer uses the other methods to be safer. I don't know why it uses a
> mix instead of doing the same thing for each drive though.

I've been bitten by the fact that disk partitions can have several names 
before. Depending on the exact set up the same partition could be called 
some or all of /dev/ada0p3, /dev/gpt/$gptlabel, /dev/gptid/$uuid, 
/dev/diskid/DISK-${disklabel}p3 or /dev/ufs/$ufslabel. ZFS pool 
importing seems to pretty much randomise which forms get used.

Personally I prefer to use partition names of the form /dev/gpt/xx-label 
where xx- is a per machine and disk prefix so I can move disks between 
machines without confusion in case of problems.

I haven't actually got round to trying this yet, but the appearance the 
various forms of partition name under /dev seem to be controlled by the 
kern.geom.label.xxx.enable sysctls. Thus if you wish to see the /dev/gpt 
forms and not have ZFS grab some alternate name, try putting

kern.geom.label.gptid.enable=0
kern.geom.label.disk_ident.enable=0

into /boot/loader.conf

-- 
Those who do not learn from computing history are doomed to
GOTO 1


More information about the freebsd-questions mailing list