Device files:
block Device file B: A device that is randomly accessed by block;
character device file C : by character, linear device;
Common block device file B: HDD
Device file name for the hard disk device:
IDE, ATA:HD
SATA, SCSI, USB:SD
A,b,c, ... To differentiate different devices under the same type
Ide:
First IDE port: Master, slave
/dev/hda,/dev/hdb
Second IDE port: master, slave
/DEV/HDC,/DEV/HDD
SD:SDA, SDB, SDC,...
Hda
hda1: First Primary partition
HDA2:
Hda3:
HDA4:
Hda5: First logical partition
character device C: keyboard
/dev Device file directory
Main device number (major numbers)
Identifying device types for differentiating device types
Secondary device number (minor numbers)
identify different devices in the same type to identify different devices in the same type
Mknod Command Introduction:
This command is used to create a device file.
1 . Command format:
Mknod [OPTION] ... NAME TYPE [MAJOR MINOR]
2 . Command function:
This command is used to create a device file.
3 . Command parameters:
-M Mode permissions
4 . Command instance:
1, Mknod Mydev C 66 0 Create a device name of Mydev type C character device The main device number is 66 times the device number is 0
2, Mknod-m 640 mydev2 C 1 Create a device name for MYDEV2 permission for 640 type C character device master device number 66 times device number 0
[Email protected] test]# ls-l/dev
Total dosage 0
CRW-RW----. 1 root video 10, 175 October 15:54 Agpgart
CRW-RW----. 1 root root 10, 57 October 15:55 AutoFS
10 Primary Device Number 57 is the secondary device number
This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1866874
Linux file type: Device file, Mknod create device file