Basics: how to identify hardware devices in Linux?

Source: Internet
Author: User


In the computers we use, memory is used for storage besides CPU operations.ProgramAnd data, there are some other devices. Such as disk drive, display card, keyboard, Nic, modem card, sound card, serial port and parallel port, etc. The various bus on the motherboard connects the device and the CPU, and then assembles them with the chassis.

To run a computer properly, each device must run under its driver (which is also part of the operating system and runs on the CPU. Drivers are associated with special files in the/dev directory, even though they are not real files.

1. Hard Disk

Each hard disk is represented as a separate device file. Generally, there can be only 2-4 IDE hard disks. This is/dev/hda,/dev/HDB,/dev/HDC, And/dev/HDD. SCSI is/dev/SDA,/dev/SDB, and so on.

2. Soft drive

The name of a floppy disk is complex. Therefore, Linux has a specific type of floppy disk, which can be used to automatically detect the floppy disk category in a floppy disk. It uses different floppy disk types to try to read the first sector of the newly inserted floppy disk until the correct one is found. This naturally requires that the floppy disk has been formatted. Automatic devices include/dev/fd0 and/dev/fd1.

3. scsi Device

When a new SCSI primary card is detected, the SCSI driver looks for connected devices. Check the system logs. Your device is correctly detected. The new SCSI device is specified as the first available SCSI device file. The first SCSI hard disk is/dev/SDA, the first SCSI tape drive is/dev/st0, and the first CD-ROM will be/dev/MDS 0.

4. Nic

Linux Ethernet NIC interfaces are usually called eth0 and eth1. Ring cards are also seen. However, they are called tr0 and tr1. The ifconfig command is used to view and modify the network interface status.Another feature of Linux is that the network interface is not considered as a file in/dev like other devices. So don't be surprised if you cannot find them in/dev.
When an Eni is detected, it is specified as the first available Interface Card Name, usually eth0.

5. Serial Devices

LINUX serial devices are all accessed through/dev/CUA * And/dev/TTYs * special device files. The TTYs * device is used in the incoming connection, for example, directly connecting to the terminal. The CUA * device is used for external connections, such as a modem. Each physical serial port has two device files, TTYs and CUA: You decide which appropriate device to use to your application.

When a serial card or data card is detected, it is designated as the first available serial device. Usually/dev/ttys1 (cua1) or/dev/ttys2 (cua2. The TTYs * device is reported in/var/run/stab.

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: 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.