Brother Bird's Private Kitchen Chapter 3-Host Planning and Disk Partitioning

1. In the Linux system, each device is treated as a file. In the Linux system, almost all device files are in the /dev (device) directory. So you will see the file names of /dev/hda, /dev/fd0, etc. The picture below shows common devices and their file names in Linux.
The Book of Private Kitchens from Brother BirdFor the SATA interface, since SATA/USB/SCSI and other disk interfaces are driven by SCSI modules, the disk device files of these interfaces are all in the format of /dev/sd[ap]. But unlike the IDE interface, the disks of the SATA/USB interface do not have a certain order at all. How to determine the device file name? At this time, it is based on the order in which the Linux kernel detects the disks.
Insert picture description here
2. The first sector of the entire disk is particularly important because it records important information about the entire disk. There are two more important information:
1) Master boot partition MBR: where the boot loader can be installed. 2) Partition table: Record the status of the entire hard disk partition. The partition table is in the first sector of the first partition, with a size of 64 bytes. It
should be noted that MBR is very important because it will take the initiative when the system is booted. Read the content of this block, so that the system will know where and how to boot your program.
3. It is necessary to understand how the disk is partitioned in the windows system. (
Niaoge Private Kitchen P69) 1) In fact, the so-called "partition" is only set for the 64bytes partition table.
2) The default partition table of the hard disk can only write the information of four groups.
3) The smallest unit of the partition is cylinder
4 ) When the system wants to write to the disk, it must refer to the disk partition table to process data for a certain partition.

4. The partition table where the first sector is located can only record four sets of data, and we can use additional sectors to record more partition information. The purpose of the extended partition is to use extra sectors to record partition information, and the extended partition itself cannot be formatted.
5. The following summarizes the characteristics of primary partition, extended partition, and logical partition.
1) There can be up to four primary partitions and extended partitions (limited by the hard disk)
2) Extended partitions can only have one at most
3) Logical partitions are partitions continuously cut out by extended partitions.
4) Only the primary partition and logical partition can be formatted, but the extended partition cannot.
5) The number of logical partitions varies depending on the operating system.
6. The computer does not have any software system when it is turned on, so when it reads the operating system files in the hard disk, it involves the computer's boot program.
7. BIOS is the first program that the computer system will actively execute when it is turned on. (BIOS is a firmware written to the motherboard. Once again, the firmware is a software program written to the hardware. CMOS is a memory that records various hardware parameters and is embedded on the motherboard). The BIOS will analyze which storage devices are in the computer. Let's take the hard disk as an example. The BIOS will obtain a bootable hard disk according to the user's settings, and go to the hard disk to read the MBR position of the first sector. MBR, which has a hard disk capacity of only 446 bytes, will contain the most basic boot loader. At this time, the BIOS is fully functional, and then the boot loader in the MBR is working.
The purpose of this boot loader is to load the kernel file, which is provided by the operating system when the program is installed when booting and loading the program, so it will recognize the file system format in the hard disk. Next is the working time of the kernel program.
Here is a summary of the entire boot process and the previous actions of the operating system:
1) BIOS: The firmware that is actively executed at boot will recognize the first bootable device
2) MBR: In the first sector of the first bootable device The main boot sub-block, which contains the boot loader
3) Boot loader: a software that can read the kernel file to execute
4) Kernel file: start the function of the operating system
8. The main tasks of the boot loader program are:
1) Provide menu: users can choose different This is also an important function of multi-boot.
2) Load kernel file: directly point to the bootable program section to start the operating system.
3) Transfer to other loader: transfer the boot loading function to other loader.
Special attention is needed. The third point, if a computer is equipped with dual systems, it is easy to understand this point. In addition to being installed on the MBR, the boot loader can also be installed on the boot sector of each partition. The following example can be well understood.
Insert picture description here9. To install dual systems, you need to install windows first, and then install linux. The reason is (Niaoge’s private kitchen P74)
10. The relationship between file system and directory tree
mounting is to use a directory as an entry point, and place the data of the disk partition in the directory, which means that you can read it when you enter the directory. The meaning of the partition. This operation is called mount, and the directory of that entry point is called mount point. The most important thing in the entire Linux system is the root directory, so the root directory must be mounted to a certain partition. Other directories can be mounted to different partitions according to requirements.

Guess you like

Origin blog.csdn.net/xiaoan08133192/article/details/114082631