Detailed Linux system under the/dev directory

Source: Internet
Author: User
Tags ide hard drive

Dev is the initials of the device (device). /dev This directory is very important to all users. Because the directory contains all the external devices used in the Linux system. But here is not the driver for the external device, which is not the same as the Windows,dos operating system. It is actually a port to access these external devices. We can access these external devices very conveniently, and access to a file, a directory without any distinction.

Linux follows the UNIX style of recognizing all devices as a single file.

There are two types of device files: Block device file (b) and character device file (c), equipment files are generally stored in/dev directory, the common equipment files are described as follows:

/dev/hd[a-t]:ide Equipment

/DEV/SD[A-Z]:SCSI Equipment

/DEV/FD[0-7]: Standard floppy drive

/DEV/MD[0-31]: Soft RAID devices

/DEV/LOOP[0-7]: Local loop device

/DEV/RAM[0-15]: Memory

/dev/null: An infinite data receiving device, the equivalent of a black hole

/dev/zero: Unlimited 0 Resources

/DEV/TTY[0-63]: Virtual terminals

/DEV/TTYS[0-3]: Serial port

/dev/lp[0-3]: and the mouth

/dev/console: Console

/dev/fb[0-31]:framebuffer

/dev/cdrom =>/DEV/HDC

/dev/modem =>/dev/ttys[0-9]

/dev/pilot =>/dev/ttys[0-9]

/dev/random: Random number device

/dev/urandom: Random number device

In a Linux system, the/dev directory is used to hold device files. Each file points to a system device. The user's program can use these device files,

operate on devices that are real hardware. For example: HDA is the 1th IDE hard drive, SDA is the 1th SCSI hard drive.

In the 2.4 kernel era, there were nearly 10,000 device files for all the hardware devices that kernel could support under/dev. and most of these devices

is a device that is not connected. This greatly wastes the system resources, and the/dev directory also appears to be very confusing.

Udev is used to solve these problems. In the 2.6 kernel, Udev is used to manage the/dev directory. It can dynamically build/delete device files (device

When connected to the system, it automatically establishes the appropriate device files, and when the device is disconnected, it automatically deletes the corresponding device files. So that the/dev directory

Simplifies a lot. Moreover, Udev can also allow users to write naming conventions that specify device file names for different devices. In this way, the management of the equipment is also convenient

Many.

For example: You have 2 U disk, 1 capacity is 1G, 1 capacity is 2G. Under normal circumstances, you first connect the U disk will be SDB, and then the U disk will be SDC. That's right.

It is inconvenient to use. The device name for each U disk may not be the same. But by Udev naming rules, you can name the device you specify, and you can name a 1G u disk

1g, the 2G u disk named 2g. The device name will not change. Use and management will be very convenient.

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.