Re: Missing disk partition devices and GPT lables in /dev/

From: Freddie Cash <fjwcash_at_gmail.com>
Date: Tue, 28 Nov 2023 20:03:02 UTC
On Tue, Nov 28, 2023 at 11:51 AM Miroslav Lachman <000.fbsd@quip.cz> wrote:

> I have strange problem on one of my machines - the disk devices in /dev/
> are only shown as ada0 and ada1 but no partition devices, no devices in
> /dev/gpt/ or /dev/gptid/, these directories are completely missing even
> though there are GPT labels.
> This is FreeBSD 13.2-RELEASE-p5 amd64 on HP Microserver Gen8. Disk are 2
> Seagate NAS 4TB, manually partitioned with gpart utility, zpool created
> and then all the date migrated by zfs send and zfs receive from old 2TB
> disks. Everything works, system is running but device nodes in /dev/ are
> missing. I noticed this only when I want to create gmirrored swap from
> ada0p4 and ada1p4 but got "No such file or directory."
>
> There are only diskid style devices in /dev/diskid/
>
<snip>

Sysctl seems normal to me.
>
> # sysctl kern.geom.label
> kern.geom.label.disk_ident.enable: 1
> kern.geom.label.gptid.enable: 1
>

Turn these two (above) off (set to 0).  Then reboot.

<snip>

> What can be wrong with this system?
>

Welcome to the wonderful world of GEOM tasting, "first match wins", and
Highlander's "There can be only 1" style of aliasing/labelling.  :)

The first alias path to a disk that is found (/dev/diskid, /dev/gptid,
/dev/gpt, /dev/ada*) and opened causes all other aliases to be hidden.  The
disk/GPT IDs seem to take precedence over other aliases/labels.  If you
want to access your disks via GPT labels, then disable the other naming
schemes via loader.conf.

-- 
Freddie Cash
fjwcash@gmail.com