What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
上一修订版两侧同时换到之后的修订记录
linux:liunxbasics:computerfundamentals:partition [2016/06/08 07:25] haregylinux:liunxbasics:computerfundamentals:partition [2021/11/11 08:07] codinghare
行 1: 行 1:
 ====Partition in Liunx==== ====Partition in Liunx====
-===== =====+----
 ===Hardrive format in Linux=== ===Hardrive format in Linux===
 For SATA, USB, SAS, these type of devices are showing in Linux like: For SATA, USB, SAS, these type of devices are showing in Linux like:
行 47: 行 47:
 </WRAP> </WRAP>
  
 +===GPT===
 +GPT: GUID partition table\\
 +GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk, using globally unique identifiers (GUID). Although it forms a part of the Unified Extensible Firmware Interface (UEFI) standard (Unified EFI Forum proposed replacement for the PC BIOS), it is also used on some BIOS systems because of the limitations of master boot record (MBR) partition tables, which use 32 bits for storing logical block addresses (LBA) and size information on a traditionally 512 byte disk sector.
 +{{ :linux:liunxbasics:computerfundamentals:guid_partition_table_scheme.svg.png |}}
  
 +==LBA0==
 +Traditionally, in IBM PC compatible systems the first sector of the disk holds the Master Boot Record (MBR), containing the drive's partitioning information and the code of the first stage boot loader for BIOS-based systems.For limited backward compatibility, the space of the legacy MBR is still reserved in the GPT specification, but it is now used in a way that prevents MBR-based disk utilities from misrecognizing and possibly overwriting GPT disks. This is referred to as a **protective MBR**.
 +==LBA1:Partition table header==
 +The partition table header defines the usable blocks on the disk. It also defines the number and size of the partition entries that make up the partition table. 
 +The header contains the disk globally unique identifier (GUID). It records its own size and location (always LBA 1) and the size and location of the secondary GPT header and table (always the last sectors on the disk). Importantly, it also contains a CRC32 checksum for itself and for the partition table, which may be verified by the firmware, bootloader and/or operating system on boot. 
 +==LBA2-33==
 +This area is used for recording partitions informations. Each LBA has 4 records, total equal to 4 by 32 = 128. Every LBA has 64Bytes space to store number of start / end sectors, Thus, GPT could provide 264 512Bytes = 263 1KBytes = 233TB = 8 ZB space.
 +===Advantages of GPT===
 +
 +  * Unordered List ItemUses GUIDs (UUIDs) to identify partition types - No collisions.
 +  * Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.
 +  * Arbitrary number of partitions - depends on space allocated for the partition table - No need for extended and logical partitions. By default the GPT table contains space for defining 128 partitions. However if the user wants to define more partitions, he/she can allocate more space to the partition table (currently only gdisk is known to support this feature).
 +  * Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB. MBR is limited to addressing 2 TiB of space per drive.
 +  * Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.
 +  * CRC32 checksums to detect errors and corruption of the header and partition table.
 +\\
 +{{ :linux:liunxbasics:computerfundamentals:gpt.png |}}
 +<WRAP center round info 100%>
 +Fdisk is not support GPT.
 +</WRAP>
 +
 +<WRAP center round important 100%>
 +Warning: For Windows, there is no support for booting from a BIOS/GPT partitioning scheme. If you have already installed Windows with a BIOS/MBR partitioning scheme do not convert the drive to GPT! Windows will fail to boot if this is done - irrespective of the bootloader used to chainload Windows. One can either install Windows in UEFI mode and use an UEFI bootloader (which uses GPT), or possibly restore/install Windows on a BIOS/GPT hybrid MBR.
 +</WRAP>
 +===BIOS / UEFI===
 +BIOS(basic input/output system) is the program a personal computer's microprocessor uses to get the computer system started after you turn it on. It also manages data flow between the computer's operating system and attached devices such as the hard disk, video adapter, keyboard, mouse and printer.\\
 +UEFI (Unified Extensible Firmware Interface) is a standard firmware interface for PCs, designed to replace BIOS (basic input/output system).\\
 +The interface defined by the EFI specification includes data tables that contain platform information, and boot and runtime services that are available to the OS loader and OS. UEFI firmware provides several technical advantages over a traditional BIOS system:
 +  * Ability to boot from large disks (over 2 TB) with a GUID Partition Table (GPT)
 +  * CPU-independent architecture
 +  * CPU-independent drivers
 +  * Flexible pre-OS environment, including network capability
 +  * Modular design
 +
 +==BIOS + MBR / GPT ==
 +{{ :linux:liunxbasics:computerfundamentals:mbr-boot-sequence-1024x385.png?700 |}}\\
 +Because GPT also have boot loader in LBA0(MBR compatible), BIOS is also able to boot from GPT.(it requires boot loader support GPT).\\
 +==UEFI Booting==
 +UEFI is designed to support GPT boot and replace BIOS. It developed by C language, so it can be easily supported by 3rd party software. Moreover, it has better user interface compare with BIOS, and could load driver before starting OS.
 +{{ :linux:liunxbasics:computerfundamentals:uefi-pic1.png |}}
 +<WRAP center round info 100%>
 +Seurty boot in UEFI will cause unbootable. Try to turn this function of if you can not boot normally.
 +</WRAP>