Linux file type: Device file, Mknod create device file

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.