2012年1月4日 星期三

MBR and GPT

MBR (Master Boot Record) 舊式 Legacy 時代的啟動磁區
共512 byte
前446 byte 是bootloader code
接著 64byte 紀錄4個 partition table 各 16 byte
最後兩個byte是 0x55AA
單一partition最大2TB

GPT(GUID partition table)
EFI 規格的一部分, 只有EFI BIOS才有支援
GPT  table 以LBA(logical block)為單位 1 LBA = 512 BYTE
LBA 0 是 protective MBR
In the GPT specification, the location corresponding to the MBR in MBR-based disks is structured in a way that prevents MBR-based disk utilities from mis-recognizing, and possibly over-writing, GPT disks. This is referred to as a "protective MBR"  In operating systems that support GPT-based boot, it is also used to store the first stage of the bootloader code. A single partition type of 0xEE, encompassing the entire GPT drive, is indicated and identifies it as GPT. 
LBA 1 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. On 64-bit Windows Server 2003 machines, 128 partitions can be created. There are 128 partition entries reserved, each 128 bytes long. (The EFI specification requires that a minimum of 16,384 bytes be reserved for the partition table, so this gives space for 128 partition entries.)
The header contains the disk GUID (Globally Unique Identifier). 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. Because of this, hex editors should not be used to modify the contents of the GPT. Such modification would render the checksum invalid. In this case, the primary GPT may be overwritten with the secondary one by disk recovery software. If both GPTs contain invalid checksums, the disk would be unusable.

LBA 2~33
128BYTES per partition 
LBA = 4 Partition 
total 4X32=128 partitions
Each partition cap to 8 ZB

沒有留言:

張貼留言