Bug or Feature? -- Disappearing /dev/ nodes after mount

Ronald F. Guilmette rfg at tristatelogic.com
Thu Jun 11 23:14:17 UTC 2020

If a disk device which has been partitioned using GPT partitioning exists
and is powered on and is installed in a given system, and if there exists
on that disk device a GPT partition which had been given the GPT partition
name `partname' then a character special device node representing that
specific partition will normally appear, automagically, underneath the
/dev/gpt/ directory.  The node in question will have the name

Interestingly, as I have just learned, when and if the user subesquently
mounts the relevant partition, the corresponding `/dev/gpt/partname' node
will, rather unexpectedly and magically, disappear until such time as the
relevant partition is unmounted, whereupon it will reappear.

Despite having looked over several of the arguably relevant man pages,
I have not found any place where this specific bit of automagical kernel
behavior is documented.  Thus, I am left with questions:

0)  Am I the only one who has observed this specific behavior?

1)  Is this behavior documented somewhere that I just failed to look at?
If so, where?

2)  Is there a consensus that the magical disappearance of /dev/gpt/ device
nodes during times when the corresponding partition is mounted represents
a feature, rather than a bug?


P.S.  Despite the occasional disappearance of /dev/gpt/ device nodes,
as described above, a complete listing of all of the GPT partitions,
irrespecitive of their mount status, along with their respective labels,
is still always available via `gpart show -l <device>'.  The `glabel list'
command also shows all relevant partitions and their GPT lables, once
again, irrespective of the mount status of any of the relevant partitions.

P.P.S. I have not checked, but it is my assumption that this disappearing
/dev/ node "feature" likely also affects device nodes that get automagically
created underneath any of the other /dev/ subdirectories listed in the
glabel(8) man page.

More information about the freebsd-questions mailing list