ITchimp wrote:
how do you know a partition entry points to a normal partition or an extended partition?
how do you know an extended partition entry exist at all?
Ref:
https://wiki.osdev.org/Partition_Table# ... PartitionsQuote:
The partition table may have one and only one entry that has the SystemID 0x5 (or 0xF). This describes an extended partition.
All the logical partitions are contained within a single MBR extended partition of type 0x5 (CHS) or 0xf (LBA).
So, you read the MBR, find one of the partitions is an extended partition by the partition type.
Then you process the logical partitions within that extended partition by walking the chain of the logical partitions, the extended boot record having the same format as a MBR, with two entries:
- The first entry describing the logical partition itself, with LBA relative to the start of the extended partition.
- The second entry pointing to the next EBR, so that EBR form a forward linked list.