viewing major and minor device numbers

Polytropon freebsd at
Fri Oct 25 19:35:07 UTC 2013

On Fri, 25 Oct 2013 12:26:31 -0700, David Newman wrote:
> FreeBSD 9.2-RELEASE, amd64
> To create some character special devices in a chroot environment, I've
> previously used mknod, but now can't find the major and minor device
> numbers.
> The ls manpage says these numbers should be displayed in the size field.
> However, I'm seeing only one hex value, e.g.:
> $ ls -l /dev/null
> crw-rw-rw-  1 root  wheel  0x13 Oct 25 12:22 /dev/null
> So I don't know what major and minor values to feed mknod. Or is there
> another way to do this?

Do you have any "suspicious" ls alias or options preconfigured?
That output looks a bit strange, it should be something like
this (example from a host system, not from inside a jail):

% /bin/ls -laFG /dev/null 
crw-rw-rw-  1 root  wheel    0,  17 Oct 25 21:33 /dev/null
                             ^   ^^

This is the binary /bin/ls, no "shell builtin" or the like,
called from the C shell; OS is FreeBSD 8, x86.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list