Reading Notes 3 of laruence's Linux private house

Source: Internet
Author: User
Tags ide hard drive

1. in Linux, each device is treated as a file, and each device has a file name. For example, the hard disk file name of the IDE interface is/dev/HD [a-d]. The letter in the brackets is any one of a-d, that is,/dev/hda,/dev/HDB, /dev/HDC and/dev/HDD files.

Device Device File Name in Linux
IDE Hard Drive /Dev/HD [a-d]
SCSI/SATA/USB hard drive /Dev/SD [A-p]
USB flash drive /Dev/SD [AP] (same as SATA)
Drive /Dev/FD [0-1]
Printer 25-pin:/dev/LP [0-2]
USB:/dev/USB/LP [0-15]
Mouse USB:/dev/USB/mouse [0-15]
PS2:/dev/psaux
Current CDROM/dvdrom /Dev/CDROM
Current mouse /Dev/mouse
Tape drive IDE:/dev/ht0
SCSI:/dev/st0

More Linux kernel supported devices reference site: http://www.kernel.org/pub/linux/docs/device-list/devices.txt


2. Disk partitioning

For the IDE interface, because an IDE cable can be connected to two ide devices, and generally the host provides two ide interfaces, a maximum of four ide devices can be connected. That is to say, if you already have a CD device, you can connect up to three more ide interfaces. These two ide interfaces are usually called ide1 (primary) and ide2 (secondary), and the IDE devices on each cable can be divided into master and slave. The four ide devices are named:

IDE \ jumper Master Slave
Ide1 (primary) /Dev/hda /Dev/HDB
Ide2 (secondary) /Dev/HDC
/Dev/HDD

3. the SATA interface is driven by the SCSI module. Unlike the IDE, the SATA/USB interface disks do not have a certain order. At this time, the disk sequence must be detected based on the Linux kernel.

Example: If the PC has two SATA disks and one USB disk, and the motherboard has six SATA slots. These two SATA disks are separately inserted in the sata1 and sata5 slots on the motherboard. Can you tell me the device names of these three disks in Linux?

A: Because the detected sequence is used to determine the device file name, it is not related to the actual slot code, so the device file name is as follows:

Name of the sata1 slot:/dev/SDA

Name of the sata5 slot:/dev/SDB

USB disk (recognized by the system after the boot is complete):/dev/SDC


4. the disk can be subdivided into two units: Sector and cylinder, each of which is as large as bytes.

The first sector of a disk is particularly important because it records two important information about the entire disk:

Primary boot partition (MBR): Where the boot loader can be installed, there are 446 bytes.

Partition Table: records the status of the entire hard disk partition, with 64 bytes


5. In the partition table, there are four groups of record areas in total. Each record area records the start and end number of the start and end of the segment (the smallest unit of the partition)

Assume that the device name of the disk is/dev/hda. The device names of the four partitions are:

P1:/dev/hda1 1 ~ 100

P2:/dev/hda2 101 ~ 200

P3:/dev/hda3 201 ~ 300

P4:/dev/hda4 301 ~ 400

Notes:

The so-called partition is only for the 64-byte partition table.

By default, the partition table of the hard disk can only write information about four partitions.

The four-component partition information is called the primary or extended partition.

The smallest unit of a partition is cylinder)

Partition Function: 1. Data Security 2. System Performance


6. Multiple logical partitions can be divided on extended partitions.

Note 1 ~ The number 4 is retained for the primary partition or extended partition. The device name Number of the logical partition starts with number 5.

A maximum of four primary and extended partitions are allowed (Hard Disk restrictions)

A maximum of one extended partition can be created (limited by the operating system)

A logical partition is a partition that is continuously cut out by an extended partition.

Partitions that can be formatted as data access are the primary partition and logical partition. Extended partitions cannot be formatted.

The number of logical partitions varies depending on the operating system. In Linux, the IDE Hard Disk can have a maximum of 59 logical partitions (numbers 5 to 63 ), SATA hard drive has 11 logical partitions (numbers 5 to 15)
If the extended partition is damaged, all the above logical partitions will be deleted.


7. if the PC has two SATA hard disks, I want to split the second hard disk into six available partitions (which can be formatted to access data ), in Linux, what is the device file name for each partition? What is the partition type? Write at least two different partitioning Methods

A: Since P + e can have up to four, e can have only one

Method 1:

P + E

Actually available are/dev/sdb1,/dev/sdb2,/dev/sdb3,/dev/sdb5,/dev/sdb6,/dev/sdb7

Method 2:

P + E

Actually available are/dev/sdb1,/dev/sdb5,/dev/sdb6,/dev/sdb7,/dev/sdb8,/dev/sdb9


8. The operation before the computer boot process goes to the operating system should be as follows:

BiOS: indicates the firmware that is automatically executed during startup (firmware is a software program written to the hardware). It recognizes the first device that can be started.

MBR: The primary boot partition in the first sector of the first device that can be started, including the Boot Loader

Boot Loader: a software that can read kernel files for execution.

Kernel File: Start the Operating System Function


9. Function of Boot Loader: Provides menus, loads kernel files, and transfers them to other loaders.


10. Each partition has its own Boot Sector (boot sector)

The actual boot kernel files are placed in each partition.

Loader only recognizes the boot kernel files in its system partition and other loaders.

Loader can direct or indirectly forward management rights to another Management Program


11. For Linux operating system files, use the directory tree, and the corresponding disk needs to have a "Mount" operation. The so-called mount is to use a directory as the entry point, put the data in the disk partition under this directory, that is, enter this directory to read the partition.

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.