MKNOD(8)

πŸ“¦
version 479 Β· 4 versions
, in nixpkgs unstable

πŸ’… mknod(8) β€” like, the make a device special file girlie

okay so this is mknod from the System Manager's Manual, section 8, and bestie… she makes device nodes. yes THAT kind. buckle up πŸŽ€


✨ SYNOPSIS ✨

mknod [-rR] [-F fmt] [-g gid] [-m mode] name [c | b] [driver | major]
      minor
mknod [-rR] [-F fmt] [-g gid] [-m mode] name [c | b] major unit subunit
mknod [-rR] [-g gid] [-m mode] name [c | b] number
mknod [-rR] [-g gid] [-m mode] name p
mknod -l

five whole moods, pick your fighter πŸ’–


🌸 DESCRIPTION 🌸

mknod creates device special files, or fifos. that's the whole job. she's an icon, she's a legend, she is the moment ✨

to make nodes manually (like, by hand, no scaffolding), the arguments are:

  • -r β€” replace an existing file if its type is incorrect. just swap it out, no drama 🫢
  • -R β€” replace an existing file if its type is incorrect and correct the mode, user and group while you're at it. she doesn't just fix the type, she fixes the whole vibe. πŸ’…
  • -F fmt β€” creates device nodes that may be used by an operating system which uses device numbers packed in a different format than NetBSD uses. highkey necessary when NetBSD is being used as an NFS server for netbooted computers running other operating systems 🌈

the following values for the fmt are recognized: native, 386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, netbsd, osf1, sco, solaris, sunos, svr3, svr4, and ultrix. yes, all sixteen. no, we're not skipping any. πŸ‘‘

  • -g gid β€” specify the group for the device node. the gid operand may be a numeric group ID or a group name. and okay, niche lore: if a group name is also a numeric group ID, the operand is used as a group name. so if you wanna force it to be a number, precede the numeric group ID with a # to stop it being treated as a name. iykyk πŸ’€
  • -m mode β€” specify the mode for the device node. the mode may be absolute or symbolic, see chmod(1). she contains multitudes πŸ¦‹
  • name β€” device name, for example β€œsd” for a SCSI disk on an HP300, or a β€œpty” for pseudo-devices. name your child, raise it right πŸŽ€
  • b | c | p β€” type of device, the classic three-way split:
    • if the device is a block type device, like a tape or disk drive which needs both cooked and raw special files, the type is b.
    • all other devices are character type devices, such as terminal and pseudo devices, and are type c.
    • specifying p creates fifo files.
  • driver | major β€” the major device number is an integer number which tells the kernel which device driver entry point to use. if the device driver is configured into the current kernel it may be specified by driver name or major number πŸ”₯

(e.g. /usr/src/sys/arch/vax/vax/conf.c). yes that's the actual path, don't @ me.

  • minor β€” the minor device number tells the kernel which one of several similar devices the node corresponds to; for example, it may be a specific serial port or pty. it's giving "which one of the twins" energy πŸ‘―
  • unit and subunit β€” the unit and subunit numbers select a subset of a device; for example, the unit may specify a particular SCSI disk, and the subunit a partition on that disk. πŸ“
(currently this form of specification is only supported by the bsdos format, for compatibility with the BSD/OS mknod). so like… yes but only the one format, bestie.
  • number β€” a single opaque device number πŸ™ˆ useful for netbooted computers which require device numbers packed in a format that isn't supported by -F. it's a mystery box, we don't open it.
  • -l β€” list the device drivers configured into the current kernel together with their block and character major numbers. a little show-and-tell, we love her πŸ’œ

πŸ” SEE ALSO πŸ”

chmod(1), mkfifo(1), mkfifo(2), mknod(2) β€” go read your sisters, they're all iconic in their own way πŸ‘‘


πŸ“œ HISTORY πŸ“œ

a mknod command appeared in Version 4 AT&T UNIX (ancient. vintage. a literal ancestor πŸ’€). the -F option appeared in NetBSD 1.4. and the -g, -l, -m, -r, -R, and -u options, plus the ability to specify a driver by name, appeared in NetBSD 2.0. glow-up of the century fr fr πŸ¦‹βœ¨


aaaand that's the whole page, no notes 🫢 this one's from Debian, dated September 12, 2016, living in section 8 of the manual β€” mwah, go make some nodes bestie πŸ’…πŸŽ€

πŸ“¦ where this page comes from
  • nixpkgs unstable: file_cmds 479
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms