Technology

What is GPT or GUID Partition Table?

What is GPT or GUID Partition Table?
Written by prodigitalweb

What is GPT?

GPT stands for GUID Partition Table, and it is the particular standard for the layout partition tables of computer storage such as SSD or HDD. The Universally Unique Identifier is also known as Globally Unique Identifier. The GUID is 128 bits long, and they assure uniqueness across space and time. It is a standard specification derived from the DCE specification with the permission of OSF. They make excellent uniform resource name and can generate new UUID without any registration process, thereby reducing the cost.

The GUID Partition Table partitioning scheme was first introduced by Intel to introduce more modern firmware to generic PC hardware. It is the successor of MBR and APM. Most of the traditional personal computer hardware uses BIOS firmware uses MBR. Whereas Intel’s latest firmware Extensible Firmware Interface includes the new partition method GPT. GUID Partition Table partitioning scheme is very flexible; it merely describes the realm of what is possible. This standard does not define how a partition can be done on a disk. But later, Apple and other giants’ policies on them.

UEFI Advantages:

It is also a part of UEFI (unified extensible firmware interface) standard specification. UEFI is the proposed replacement of PC BIOS. It is yet used by some BIOS systems due to the limitations of MBR partition tables. All latest Operating Systems support GUID Partition Table, including Windows and macOS. They support booting from the GUID partition table with EFI firmware. The Distro and free and open source distributions can boot from GPT partitions on computer systems either with EFI firmware or the BIOS.

They are of 128 bits fixed size, which is very small when compared with any other available alternatives. Therefore, it helps you sort, order, hashing, allocate, and store the database. Moreover, it is easy to use in programming. One of the main reasons for using GUID is that have no centralized authority to administer and advocate them. Therefore its algorithms support very high allocation rates of up to ten million per second per machine. Moreover, it could use the transaction IDs as and when necessary.

The Master Boot Record partitioning previously used has many limitations while using it in modern hardware. They have only 32 bits for block addresses and related information. The available sizes for hard disks are 512 bits sectors of a maximum size of 2.2 TB. Whereas GUID Partition Table uses 64 bits for block addresses and allows the maximum size of 264 sectors. Therefore the maximum size can be 9.44 ZB. In the middle of 2010, hard disk manufacturers introduced an advanced format with 4096-byte sectors that are compatible with legacy hardware and software. That advanced format technology includes the emulation technology that possesses entities accessing the hard drive.

Cylinder Header Sector Addressing and Logical Block Addressing:

The GPT replaces the cylinder header sector addressing with logical block addressing. The GUID Partition Table header is in LBA1, and its pointer to the partition table entry array is at LBA 2, and for MBR header is at LBA 0. In the partition table, each entry is of 128 bytes size. Further, the UEFI specification stipulates that a minimum of 16384 bytes must be allocated for the partition entry array of the sector size. Therefore on a 512- bytes sector disk drive, at least 32 sectors are needed to be used for the partition entry array; hence the first usable block is at LBA 34 or higher. Whereas in disk with 4096 bytes sectors, at least 4 sectors are used for the partition entry array, and the very first usable block is at LBA 6 or higher.

What is MBR?

Master Boot Record is a special type of boot sector in the early 1980s. The MBR stores the information about the logical partitioning file system employed on the disk. Besides it, it also contains the executable codes to work as a loader for the Operating System. It passes control over to the loader in conjunction with the Volume Boot Record in the second stage. MBR partition solely depends on 512 bits of the first sector of the hard disk partition. The first 440 bytes of 512 bits are meant for the boot loader code. The System BIOS reads the code and executes it when the system is switched on.

What is Legacy MBR?

It is the traditional partition method. Legacy MBR is the Master Boot Record Partition used before UEFI and GPT. The UEFI system also can boot from the Legacy MBR. The Legacy MBR contains only a maximum of four partitions, primary and extended. One of them is market as marked as the partition type 0xEF, and it is similar to a bootable flag. It is loaded by the UEFI Firmware. Legacy partitions do not contain any EFI System Partition.

What is LBA?

Logical Block Addressing (LBA) is basically a single number addressing the drive. It is denoted as LBA 0, 1, 2, and so on. The common size of LBA is 512 bytes. In the beginning, the IDE specified LBA as a 22 bits number, and it can store a maximum of 2 GB of data. Later in ATA-1 specification, it increased to 28 bits number, and it can store a maximum of 128 GB of data. Finally, the ATA-6 specification was further increased to 48 bits, and it can store 128 PB of data.

What is Protective MBR (LBA 0)?

The protective MBR is an MBR that defines a single partition entry LBA 0 to cover the entire area of the disk used by GUID Partition Table structures and partitions. It is similar to an HFS wrapper around an HFS Plus disk.

GPT specification still has reserved space for the legacy MBR for limited backward compatibility. Though LBA 0 was reserved for backward compatibility, it is used to prevent the disk utilities from overwriting and wrongly re-organizing the data. It is also named as protective MBR. EEh single partition type can encompass the entire GUID Partition Table drive. And it identifies and indicates it as GUID Partition Table. It helps the other tools and Operating Systems which cannot identify and read the GPT to recognize the disk as the disk contains one partition of unknown type and there is no empty space left out to write.

Further, it typically refuses to modify the disk unless otherwise the users explicitly request to delete the partition. It enhances disk protection and minimizes any accidental erasures. The Operating Systems can identify and check the protective MBR. If the enclosed partition type is not of EEh or if there are multiple partitions defined on the hard disk, the Operating system may refuse to alter the partition table. If the disk size exceeds the maximum partition size, that can be represented by legacy 32 bits LBA entries in the MBR partition table. The recorded size of this clipped to the maximum overlooking the rest of the disk.

GPT EFI Protocol:

Since most of the old personal computers are hardcoded for the sector size of 512 bytes with 32 bits calculations, exceeding the limit of 2TiB could cause compatibility issues. Most of the GUID Partition Table aware programs readily identify and recognize the drive that contains GPT by checking the first and last block as per the EFI protocol. Besides, it checks Block 0, whether it contains a protective MBR. If it includes any form of MBR partitions, then it refuses to manipulate the disk. In addition, if Block 0 contains an MBR with one partition entry or more than one partition entry, whose OSType is not 0xEE, it means it is not a GUID Partition Table compliant disk. And altering it may lead to dangerous inconsistencies.

Hybrid MBR LBA (0+ GPT)

The first sector may also store the preliminary stage of BootLoader code in Operating Systems that support GPT based boot through BIOS rather than EFI. It is modified in such a way to recognize GUID Partition Table partitions.

What Are MBR Limitations?

Next to the boot loader code, MBR stores the data related to the primary partitions. Each partition is described using Cylinder Head Sector and Logical Block addressing notations. The CHS is of 24 bits; therefore, it is limited to describe the size of 8 GB, and the 32 bits size LBA can address the values to the size of the 2TiB size of the drive. There are some issues to overcome the ceiling due to the lack of unallocated fields left with the LBA addresses.

The four primary partitions also have some limitations in MBR. To overcome the limitations, one primary partition can be treated as an extended partition to hold additional partitions known as logical partitions. But that also has some issues when you are installing multiple Operating Systems when too many of them need to be assigned and function as a primary partition themselves. The MBR has data- integrity problems.

It uses a single data structure that is easily vulnerable to damage or corrupt due to hardware issues or human negligence. The logical partitions are defined in a linked list structure. If any damage happens to any partition, that may block the access of the remaining logical partitions. MBR partition data structure does not have the error detection capability. Therefore it is very difficult to identify or locate the damage or the error.

How GUID Partition Table Gives Solution to Master Boot Record Partition?

We already discussed the Extensible Firmware Interface (EFI) specification is the BIOS replacement. The GUID Partition Table the standards, which replaces BIOS Legacy. Besides, GPT can even be used in BIOS-based Systems. In fact, GUID Partition Table can fix many of the MBR limitations in both legacy BIOS and Extensible Firmware Interface (EFI).

  • GPT replaces CHS with LBA.
  • Disk Pointers are 64 Bits in size.
  • GUID Partition Table can handle the disks of size 8 Zebibytes of 512-byte sectors of size.
  • The data structure is stored in the first and last entry of LBA. This double-entry helps in successful recovery in case of any accidental damage or a bad sector.
  • For critical data structures, cyclic redundancy check values are computed for deducting and protecting from data corruption.
  • It stores all partitions in a single partition table, including backup.
  • Therefore no need for extended or logical partition is needed.
  • GUID Partition Table can support 128 partitions by default.
  • You can also change the partition table size if your Operating System allows such change.
  • To avoid partition type collisions, GUID Partition Table uses 16 bytes Globally Unique Identifier value to identify partition types, whereas MBR provides a single byte partition type code.
  • GPT allows storing a human-readable partition name, which means you can name the partitions for easier identification.

The GUID Partition Table disk drive is self-identifying. Therefore, even information needs to read and interpret the partition scheme of a GUID Partition table that is completely contained in the specific location of the drive.

What are the Advantages of GPT?

  • Unlimited primary partitions
  • Safeguarded by the CRC32 checksums
  • Clear Identification of Drive Partitions and Data
  • Backup Header
  • Backward compatibility
  • Best compatibility with larger hard drives
  • Quick Boot-Time
  • Recovery of Data is an effortless task

 GPT Header Format:

GUID Partition Table Header Format

Partition Table Header Format LBA 1

GPT Header Format

Offset Length Content
0 (0x00) 8 Bytes Signature EFI Part
8 (0x08) 4 Bytes Revision 1.0 (00h 00h 01h 00h) for UEFI 2.8
12 (0x0C 4 Bytes Header size (in bytes, usually 5Ch 00h 00h 00h or 92 bytes)
16 (0x10) 4 Bytes
CRC32 of the header (offset +0 up to header size)
20 (0x14) 4 Bytes Reserved must be zeros
24 (0x18) 8 Bytes Current LBA (location of header copy)
32 (0x20) 8 Bytes Backup LBA (location of other header copy)
40 (0x28) 8 Bytes First usable LBA for partitions (primary partition table last LBA + 1)
48 (0x30 8 Bytes Last usable LBA (secondary partition table first LBA − 1)
56 (0x38) 16 Bytes Disk GUID
72 (0x48) 8 bytes Starting LBA of array of partition entries
80 (0x50 4 Bytes Number of partition entries in an array
84 (0x54) 4 Bytes Size of a single partition entry
88 (0x58) 4 Bytes CRC32 of partition entries array
92 (0x5C) * Reserved; must be zeroes for the rest of the block (420 bytes for a sector size of 512 bytes; but can be more with larger sector sizes)

GPT LBA 1

The information stored in the partition table header defines the usable blocks in the disk. It also stores the size and number of partition entries in the table. Extensible Firmware Interface allocates a minimum of 16 384 bytes be reserved for the partition table array. So there are 128 partition entries reserved with 128 bytes of length. As we already discussed, the header contains the globally unique identifier GUID. It stores its own size and location at LBA 1.

The size and location of the secondary header and table are always stored in the last sectors on the disk. It also contains cyclic redundancy check 32 checksum for it and for the partition table. It may first be verified by the bootloader or the firmware during the booting. Because of it, the hex editors should not be used to modify the content of GPT. Any such modification will affect the cyclic redundancy check 32 checksum invalid. If both cyclic redundancy check 32 contain invalid checksums, most bootloaders will not work until the corrupted partition tables are removed or repaired.

Partition Entries (LBA 2–33)

GUID Partition Entry Format

Offset Length Content Details
0 (0x00) 16 Bytes Partition type GUID
16 (0x10) 16 Bytes Unique partition GUID
32 (0x20) 8 Bytes First LBA
40 (0x28) 8 Bytes Last LBA
48 (0x30) 8 Bytes Attribute Flags
 56 (0x36) 72 Bytes Partition Name

Nest to the header, the partition entry array details the partitions using the minimum size of 128 bytes for each block entry. Each entry’s location and array details are given in the GPT header.

The first 16 bytes of the partition entries are used to define the GUID partitioning type. The next 16 bytes contain the GUID that is unique to the partition. From next to that, the record of start and end of the64- bit LB if applicable. The remaining space is meant for the names and attributes of the partition.

MBR Vs. GPT:

Details MBR GPT
Primary Partitions 4 128
Partition Size Max. 2 TB 18 Billion Gigabytes
Hard Drive Size 2 TB 18 Billion Gigabytes
Security No Cyclic Redundancy Check 32 checksum Cyclic Redundancy Check 32 checksum is there to protect
Specification Legacy BIOS UEFI
Partition Name Partition name stored in the partition itself Has a unique GUID in the header
Multiple Boot Support It is lacking Bootloader entries support multiple boots
Operating System Support Support old Operating System Supports all major Operating System
Data Recovery Very tough to recover data Can recover Data quickly
Data Corruption Deduction Could not identify data corruption Can identify Data Corruption easily
Partition Addressing CHS or LBA Logical Block Addressing
Size 512 bytes 512 bytes in each LBA
Partition Type Code 1 Byte GUID use 16 bytes
Stability Less stable More stable compared to MBR
Bootable Version of OS Boot 32 Bits OS Boots 64 Bits OS
Storage Capacity Up to 2 TB Up to 9.44 Million TB
Performance Less efficient compared to GPT More efficient compared to MBR
Partitioning Method Old Partitioning standard Latest partitioning standard
 

 

About the author

prodigitalweb