Device nodes and major/minor numbers

6.14 LPAR mode z/VM guest KVM guest

The Linux® kernel represents character and block devices as pairs of numbers <major>:<minor>.

Some major numbers are reserved for particular device drivers. Other major numbers are dynamically assigned to a device driver when Linux boots. For example, major number 94 is always the major number for DASD devices while the device driver for channel-attached tape devices has no fixed major number. A major number can also be shared by multiple device drivers. See /proc/devices to find out how major numbers are assigned on a running Linux instance.

The device driver uses the minor number <minor> to distinguish individual physical or logical devices. For example, the DASD device driver assigns four minor numbers to each DASD: one to the DASD as a whole and the other three for up to three partitions.

Device drivers assign device names to their devices, according to a device driver-specific naming scheme. Each device name is associated with a minor number.

Figure 1. Minor numbers and device names
This graphic shows a minor number with a pointer to a device and its name as known by a device driver

User space programs access character and block devices through device nodes also referred to as device special files. When a device node is created, it is associated with a major and minor number.

Your distribution might create these device nodes for you or provide udev to create them. If no devices nodes are provided, you must create them yourself.