SOLVED zpool not using gptids

bobpaul

Dabbler
Joined
Dec 20, 2012
Messages
23
Today I noticed that one of our FreeNAS systems is showing /dev/da[0-5]p2 device names instead of gptid/[uuid] device names. See:


Code:
# zpool status storage
  pool: storage
 state: ONLINE
  scan: scrub repaired 0 in 0 days 07:33:27 with 0 errors on Sun Dec  8 07:34:03 2019
config:

    NAME        STATE     READ WRITE CKSUM
    storage     ONLINE       0     0     0
      raidz2-0  ONLINE       0     0     0
        da4p2   ONLINE       0     0     0
        da5p2   ONLINE       0     0     0
        da0p2   ONLINE       0     0     0
        da1p2   ONLINE       0     0     0
        da3p2   ONLINE       0     0     0
        da2p2   ONLINE       0     0     0


Also weird... the disks are GPT partitioned, ex:

Code:
# gpart show da5
=>        34  5860533101  da5  GPT  (2.7T)
          34          94       - free -  (47K)
         128     4194304    1  freebsd-swap  (2.0G)
     4194432  5856338696    2  freebsd-zfs  (2.7T)
  5860533128           7       - free -  (3.5K)


but they don't show in glabel status

I understand this to be bad if the device order ever changes between bootups (ex da4 is missing so da5 from last boot shows as da4 this boot). I'm not sure how we got in this situation as I'm rather certain we used the webui when we setup this pool many years ago, but whatever... I'm now wondering what the best way out of this is.

I figure using the webui I should be able to offline da5 and then re-add (triggering a resilver) it and I'd expect it to show up with its gptid. But is there a better way that doesn't involve resilver (maybe there's something I can do by exporting, fixing whatever's preventing them the disks from having gptids, then then re-importing the pool)?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
FreeNAS usually hides the GPTID in zpool status, but does often lose the ability to do that and shows GPTIDs again.

Underneath the hood, FreeNAS only cares about the GPTID, so the ada/da numbering matters for nothing in the end other than a human convenience for reference.

Don't be concerned.
 

bobpaul

Dabbler
Joined
Dec 20, 2012
Messages
23
FreeNAS usually hides the GPTID in zpool status, but does often lose the ability to do that and shows GPTIDs again.

In the WebUI, sure. But I'm seeing this in zpool status from the shell. When I run the shell command on our other FreeNAS boxes it shows the GPT IDs. I don't think the FreeNAS developers patched the zpool command, did they? I imagine the translation from GPTID to device name in the WebUI is handled by the middleware.

My suspicion is that someone on our team did something from the shell instead of from the WebUI at some point and it went unnoticed until now.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The CLI also shows both. Again, don't sweat it.

Editing a pool in the CLI may be one of the triggers to make it switch.
 
Last edited:

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
GPTID in zpool status,
I have never seen this, it's always GPTIDs, except for freenas-boot, which is ...not for some reason.
 

bobpaul

Dabbler
Joined
Dec 20, 2012
Messages
23
So I think sretalla is correct; on FreeBSD it doesn't sound like the device names shown by the zpool commands matter. The ZFS section of the FreeBSD handbook uses the /dev/da# device names exclusively and I also found this thread on the FreeBSD forums where they discuss and experimented on this same question. On FreeBSD, ZFS uses internal GUIDs and the device names don't matter.

The confusion comes in because ZFS on Linux (which I've been working with a bit recently) behaves differently and does require users take care to use relocatable device names (like /dev/disk-by-uuid/...).

----

That said, the device names shown by the zpool command are stored in /data/zfs/zpool.cache (and zpool.cache.saved). If you really want to change the names, export the pool and then use zpool import -d /dev/gptid/ when importing the pool. The -d option names the directory to scan for devices; /dev/ is used by default. On bootup, FreeNAS does zpool import -c /data/zfs/zpool.cache.saved.
 
Top