MKNOD(8,C) AIX Commands Reference MKNOD(8,C)
-------------------------------------------------------------------------------
mknod
PURPOSE
Creates a special file.
SYNTAX
+--- c ---+
+-| |- major --- minor -+
| | +-----+ | | +----------------+
mknod --- device ---| +-| b |-+ |---| +------------+ |---|
| | c | | ^ +-| |-+ |
| +-----+ | | +- sitename -+ |
+-------------- p --------------+ +--------------------+
DESCRIPTION
The mknod command makes a directory entry and corresponding inode for a special
file. The first parameter specifies the name of the entry device.
The mknod command has two forms. In the first form, the second parameter is b
or c. The b flag indicates the special file is a block-oriented device (disk,
diskette, tape). The c flag indicates the special file is a character-oriented
device (other devices). The next two parameters are numbers specifying the
major device, which helps the operating system find the device driver code; and
the minor device, that is, the unit drive, or line number, which can be either
decimal or octal. The final optional parameter, sitename, specifies the
cluster of sites where the device is located. If no site name is specified,
the newly created specid file refers to a device on the site where this command
is run.
The assignment of major device numbers is specific to each system. Device
numbers are determined by examining the system file /etc/master.
Note: If you change the contents of /etc/master to add a device driver, you
must rebuild the operating system. See the discussion of device drivers
in AIX Operating System Technical Reference.
The second form of mknod is used to create FIFOs (named pipes). The p flag
after device indicates you are creating a named pipe. See the AIX Operating
System Technical Reference for an explanation of FIFOs and named pipes.
FLAGS
b Indicates the special file is a block-oriented device.
Processed November 8, 1990 MKNOD(8,C) 1
MKNOD(8,C) AIX Commands Reference MKNOD(8,C)
c Indicates the special file is a character-oriented device. This is the
default.
p Creates a named pipe.
EXAMPLES
To create the special file for a new diskette drive:
mknod /dev/fd2 b 1 2
This creates the special file /dev/fd2, which is a block special file with
major device number "1" and minor device number "2", and refers to a device on
the local cluster site.
RELATED INFORMATION
See the mknod system call and discussion of device drivers in AIX Operating
System Technical Reference.
Processed November 8, 1990 MKNOD(8,C) 2