I am reading up a bit on Master Boot Record layout and I was particularly interested in how the partition layout causes a size limitation on the size of the storage that can be used on a device with MBR.
Each partition within an MBR is defined using a 16 byte entry. The usage of those 16 bytes is as follows:
- 1st byte, if it has a value of 80, indicates active partition
- 2nd byte, the head number where the partition begins. This means MBR can address 256 different heads
- 3rd byte, the first 6 bits are used to capture the sector number of the 1st sector of the partition. This means MBR can address 64 different sectors
- 4th byte + last 2 bits of 3rd byte (total of 10 bits) store the track number where the partition begins. This means a total of 1024 tracks can be addressed using MBR partition entry.
- 5th byte (OS indicator)
- 6th byte the head number where the partition ends
- 7th byte, the first 6 bits are used to capture the sector number of the last sector of the partition
- 8th byte + last 2 bits of 7th byte store the track number where the partition ends
- Bytes 9, 10, 11, and 12 capture how many sectors where there before the beginning of the partition
- Bytes 13, 14, 15, and 16 capture how many sectors are there in the partition
Suppose we have only 1 partition in MBR and I make that the active partition. The zeroth sector is occupied by the MBR itself while the first partition starts from sector 1. Then the total number of sectors in this partition are:
2^10 = 1024 (number of tracks)
2^6 = 64 (number of sectors)
2^8 = 256 (number of heads)
1024 * 64 * 256 = 16,777,216 sectors
With every sector containing 512 bytes we get a maximum partition size of 8,589,934,592 (8.5 GB). If this is correct (which I doubt), shouldn't the maximum size of a disk addressable by MBR be 8.5 GB? I see everywhere they talk of 2.1 TBs and I am unable to understand how.