/proc/devices: Explanation & Insights
Information about character and block devices
In Linux, the /proc/devices
file provides information about the character and block devices currently configured in
the system. Each line of the file represents a device, and it contains the major and minor numbers of the device,
as well as its name.
The major number identifies the driver responsible for the device, while the minor number is used by the driver to distinguish between different instances of the device. The name of the device is a user-friendly identifier that can be used to access the device from the command line or from within programs.
Here is an example of the /proc/devices
file:
Character devices:
1 mem
4 tty
7 vcs
10 misc
13 input
29 fb
81 video4linux
128 ptm
136 pts
180 usb
189 usb_device
251 hidraw
Block devices:
259 blkext
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
253 device-mapper
254 mdp
In this example, the file shows a list of character devices and block devices currently configured in the system.
For character devices, some examples are:
mem
: a character device that represents physical memorytty
: a character device that represents a terminalinput
: a character device that represents input devices such as keyboards and miceusb
: a character device that represents USB devicesvideo4linux
: a character device that represents video capture devices
For block devices, some examples are:
sd
: a block device that represents a SCSI diskloop
: a block device that represents a loopback devicedevice-mapper
: a block device that represents a device mapper targetmdp
: a block device that represents the multi-device path driver