ZFS How are zpool devices determined?

I have been trying to figure this out, why does zpool status displays different disk description on different devices? I have multiple machines in my homelab, and it seems there are multiple presentations for disks depending on the machine. I am specifically referring to what the device is called in zpool status.

So I have three Lenovo m710q Tiny mini-servers, all of which have one SSD and one NVMe drive in a mirrored pair. In addition, I also have a laptop with a mirrored pair of SSDs in it. So the NVMe drives are a separate problem not covered here (sometimes it is called /dev/nvme* and other places it is referred to as /dev/nda*).

So I have the following servers:
Code:
ares (m710q Tiny)
  /dev/ada0 = Crucial CT480BX500SSD1
zpool status:
        NAME          STATE     READ WRITE CKSUM
        NCC1650       ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            gpt/zfs0  ONLINE       0     0     0
            nda0p3    ONLINE       0     0     0

artemis (m710q Tiny)
  /dev/ada0 = WDS100T2B0A-00SM50
zpool status:
       NAME          STATE     READ WRITE CKSUM
        NCC1658       ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            gpt/zfs0  ONLINE       0     0     0
            nda0p3    ONLINE       0     0     0

danube (Lenovo w520)
  /dev/ada0 = Crucial CT480BX500SSD1
  /dev/ada1 = SanDisk SDSSDA480G
zpool status:
        NAME            STATE     READ WRITE CKSUM
        NX72003         ONLINE       0     0     0
          mirror-0      ONLINE       0     0     0
            ada1p3.eli  ONLINE       0     0     0
            ada0p3.eli  ONLINE       0     0     0

In addition, I have seen other combinations on other platforms, including some where every drives is by gptid/<really long string>, and on my desktop machine, which has two pools, one a mirrored pair of NVMes and the other of spinning rust, I have:
Code:
           nda0p3  ONLINE       0     0     0
           nda1p3  ONLINE       0     0     0
and
           ada2p2  ONLINE       0     0     0
           ada1p2  ONLINE       0     0     0

So my question is, is it possible to manage a setting to control how disk devices are displayed? Especially how it is presented to zpool?

Thanks!
 
If I understand your question, it comes down to what name is used in the zpool command.

Very rough example:
You have a SATA device that shows up at /dev/ada0. You use gpart commands to partition and label the partitions, giving you /dev/ada0p2 with a gpart label of "mystuff". You have sysctls set to enable all the different types of labels (gpart/gpt labels, glabel, diskuid)
The system boots and in the beginning that partition can be referenced by /dev/ada0p2, /dev/gpt/mystuff plus /dev/diskid/something.

Now you want to pull that into zfs vdev, so you do a "zpool attach/add". How you reference that partition is what shows up in the zfs/zpool status commands.
Your first block, you likely gpart labeled a partition as zfs0 and then used gpt/zfs0 in creating the mirror.
The second mirror using the GELI bits, obviously you used the encrypted names.

All the other examples you likely used the raw /dev/adaXpY names when doing the zpool/zfs commands.

For the mirrors, you can use gpart to label the partitions (gpart list to show), then once you figure out what gpart label corresponds to which raw device, you can zpool detach the old name and then gpart attach gpt/whateverthelabelis

sysctls that enable what "disk ids" are available:
kern.geom.label.disk_ident.enable
kern.geom.label.gptid.enable
kern.geom.label.ufsid.enable
 
Back
Top