Creating device nodes
You can use the mknod command to create device nodes.
To create a device node, use a command
of the form:
# mknod <node> <mode> <major> <minor>
where: - <node>
- specifies the path to the node. You can use any path. To comply
with Linux® conventions,
the path should begin with
/dev/
. - <mode>
- is
c
for character devices andb
for block devices. For each minor number, you can define a character device and a block device. - <major>
- is the major number that identifies the required device driver to the kernel.
- <minor>
- is the minor number that maps to a device name used by the device driver.
Figure 1 shows a standard device node that matches the device name that is used by the device driver. You need not use the standard device nodes. Which device a device node maps to is determined by the major and minor number that is associated with it. You can have multiple device nodes that all map to the same device.
For example, the following commands
all create device nodes for the same device:
# mknod /dev/dasda b 94 0
# mknod /dev/firstdasd b 94 0
# mknod /dev/as/you/please b 94 0
For some device drivers, the assignment of minor numbers and names can change between kernel boots, when devices are added or removed in a z/VM® environment, or even if devices are set offline and back online. The same file name, therefore, can lead to a different device.