[daily] basic concepts for beginners to install BIOS and hard disk partition

Keywords: Linux Windows

In the past two days, because of testing in linux, the system of linux was broken first, and then the boot was broken after reinstalling the linux system. In the process of repairing the boot, the win8 system of the machine was damaged. After repairing the boot and reinstalling linux again, linux can access it. After reinstalling the windows system, it still can't, and the boot part can't either. From my experience, it can be seen that using linux as a daily system has great risks, because its permissions are very high and the dependence of some software may modify the dependency Library of the local interface. After modification, it is very easy to make the interface unresponsive. You must be careful.

When we are installing the system, the first thing is to enter the BIOS setting interface of the computer first. What is the BIOS?
BIOS is the abbreviation of Basic Input Output System. It means Basic Input Output System. It is a system between hardware and operating system. In essence, BIOS is a software, which is integrated on the main board. Intel later upgraded the BIOS specification, and the BIOS was upgraded to UEFI BIOS. The new computer generally uses UEFI BIOS, and can be configured as a traditional BIOS, also known as legacy.

When using UEFI BIOS, UEFI needs to access EFI partition and look for boot file of operating system.
During the installation, there is also a Secure Boot option. This option itself is for security, but Microsoft has evolved into a tool to prevent changing the pre installed windows system to other systems. Therefore, it is recommended to turn off this option.

Use fdisk-l in the linux system I can enter to check the partition of hard disk:

root@tao-PC:/boot# fdisk -l /dev/sda
Disk /dev/sda: Four 65.8 GiB, 50010 Seven 862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 7FB53ABC-61C6-43F7-B32D-2EC645A394CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   2050047   2048000 1000M BIOS boot
/dev/sda2    2050048   2582527    532480  260M EFI System
/dev/sda3    2582528   2844671    262144  128M Microsoft reserved
/dev/sda4    2844672 317433855 314589184  150G Microsoft basic data
/dev/sda5  317435904 527149055 209713152  100G Microsoft basic data
/dev/sda6  527151104 736864255 209713152  100G Microsoft basic data
/dev/sda7  736866304 841721855 104855552   50G Microsoft basic data
/dev/sda8  841723904 946579455 104855552   50G Microsoft basic data
/dev/sda9  946581504 976773119  30191616 14.4G Windows recovery environment

Use the parted command to view the current partition situation, and enter the p command after parted.

root@tao-PC:/boot# parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA ST500LM021-1KJ15 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  1050MB  1049MB                                             hidden, bios_grub
 2      1050MB  1322MB  273MB   fat32        EFI system partition          boot, esp
 3      1322MB  1456MB  134MB                Microsoft reserved partition  msftres
 4      1456MB  163GB   161GB   ntfs         Basic data partition          msftdata
 5      163GB   270GB   107GB   ext4         Basic data partition          msftdata
 6      270GB   377GB   107GB   ntfs         Basic data partition          msftdata
 7      377GB   431GB   53.7GB  ntfs         Basic data partition          msftdata
 8      431GB   485GB   53.7GB  ntfs         Basic data partition          msftdata
 9      485GB   500GB   15.5GB  ntfs                                       hidden, diag

Disklabel type: gpt
Partition Table: gpt means that the partition table is gpt. gpt replaces the traditional mbr. Using gpt can support more than 2T of larger hard disks, and mbr will not work. Therefore, under the guidance of UEFI, gpt partition tables are used.
The value in my other computer is dos

The first partition / dev/sda1 is BIOS boot. The Flags are hidden and BIOS grub. Under traditional BIOS legacy, if the hard disk uses gpt partition table, you need to create such a BIOS boot partition.
The second partition, / dev/sda2, is EFI System, and Flags are boot and esp. this is the ESP partition mentioned earlier. The file system is fat32, which means that the boot program of the system will be called from this partition in UEFI mode.
/dev/sda5 is the partition where I install linux system. It is mounted to the root directory and the file system is ext4.
Other partitions are the ones that computers buy. They are related to win system.

Use lsblk to list block device information - f to display the file system

root@tao-PC:/boot# lsblk -f
NAME   FSTYPE LABEL           UUID                                 MOUNTPOINT
sda                                                                
├─sda1                                                             
├─sda2 vfat   SYSTEM_DRV      B467-E8A8                            
├─sda3                                                             
├─sda4 ntfs   Windows8_OS     8A461C98461C875B                     /media/tao/Windows8_OS
├─sda5 ext4                   e297ae56-7c17-48ea-aac5-f26c1e5cad84 /
├─sda6 ntfs   entertainment            7C387F10387EC8A2                     /media/tao/entertainment
├─sda7 ntfs   To work in an office            CC5A23C35A23A8E2                     /media/tao/To work in an office
├─sda8 ntfs   Software            4E8CEF168CEEF6FD                     /media/tao/Software
└─sda9 ntfs   Lenovo_Recovery CE3C64723C64578B 

Posted by dotbands on Sat, 26 Oct 2019 02:47:15 -0700