MKNOD(8)
π 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 themode,userandgroupwhile 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, seechmod(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
pcreates fifo files.
- 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
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 π―unitandsubunitβ 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 thebsdosformat, for compatibility with the BSD/OSmknod). 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
- Copyright (c) 1980, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms