Solved Missing /dev/gpt

Hi!

After upgrade to 12.1 from 11.4 the folder /dev/gpt somewhere gone. The root is on zfs and loaded by 'diskid'. Also the oddity is that system contains 5 disks but '/dev/diskid' only 2 records. gpart show -l shows labels properly. In logs nothing related

Thanks
 
Thanks, but not in case. The system's root is on zfs and it mount point in properties. In fstab only swap and fdescfs
 
  • Thanks
Reactions: a6h
For a list of all the label tunables, use sysctl kern.geom.label. You can verify that kern.geom.label.gpt.enable is set to 1, which means you should have something in /dev/gpt, assuming at least one GPT partition with a label is unmounted.

In case you're unaware, a GPT partition's label/ID is unlisted if the partition is not mounted using that label/ID. By extension, if all GPT partitions are mounted/online through their /dev/XXXpNN names, then /dev/gpt and /dev/gptid will not even exist. As an example, /dev/gpt/zfs1 will not appear when it is online on my system:
Code:
ROOT# ls -C /dev/gpt
efiboot0    efiboot1    gptboot0    gptboot1
ROOT# zpool offline desktop zfs1
ROOT# ls -C /dev/gpt
efiboot0    efiboot1    gptboot0    gptboot1    zfs1
ROOT# zpool online desktop zfs1
ROOT# ls -C /dev/gpt
efiboot0    efiboot1    gptboot0    gptboot1

Instead of taking a ZFS device offline, you can also test behavior using a small memory disk (see mdconfig(8)); I used mdconfig -at malloc -s 100m and 1 UFS partition. Once you have the partitions set up on it, you can mount/online and unmount/offline them as desired (assuming they contain mountable filesystems). Don't forget to detach the memory disk once you're finished.

As for having 2 /dev/diskid entries when you have 5 disks, I don't know why that happens since I have set kern.geom.label.disk_ident.enable to 0 and the only mention of /dev/diskid I've found is in glabel(8).
 
When both kern.geom.label.disk_ident.enable and kern.geom.label.gpt.enable are turned on items in /dev/gpt removed. Wrote kern.geom.label.disk_ident.enable="0" in loader.conf and /dev/gpt returns.
 
When both kern.geom.label.disk_ident.enable and kern.geom.label.gpt.enable are turned on items in /dev/gpt removed. Wrote kern.geom.label.disk_ident.enable="0" in loader.conf and /dev/gpt returns.
Glad to hear you got things working. I suppose that explains why I have it in my /boot/loader.conf. It might help future readers with the same trouble if you mark this thread [Solved] :)
 
Back
Top