The block device file
The character device file
The named pipe file
The socket file
A block device file is a file that reads and writes data in block. Such files are useful when data needs to be written in bulk. Devices such as hard disk drive, USB drive, and CD-ROM are considered as block device files. Data is written asynchronously and, hence, other users are not blocked to perform the write operation at the same time.
To create a block device file,
mknod is used with the option
b along with providing a major and minor number. A major number selects which device driver is being called to perform the input and output operation. A minor number is used to identify subdevices:
$ sudo mknod block_device b 0X7 0X6
$ ls -l block_device brw-r--r--. 1 root root 7, 6 Aug 24 12:21 block_device...