4

When partitioning from scratch a USB Flash drive (8GB or larger) under Windows (diskpart) or Linux (gparted, fdisk) as Master Boot Record with a single partition, that partition usually starts at byte 1048576 (1MiB). To non-destructively display that value under Windows try (lowercase characters optional)

DISKPART
LISt DISk
SELect DISk !      (use appropriate disk number)
SELect PARtition 1
DETail PARtition   (among other things, tells where the partition starts)
EXIt

The value is down to 65536 (64kIB) for 1GB to 4GB drives. Under diskpart, the (DESTRUCTIVE) CLEan then CREate PARtition PRImary OFFSET=32 is supposed to reduce that to 32kiB, but instead is silently ignored if below the minimum value diskpart wants (1024 or 64 depending on drive). Lower values cause an error.

When partitioning under OS X (Disk Utility) and asking for MBR, one gets the first partition at 1024 (1kiB). That's about 1MiB more usable space (for an 8GB drive). I have not found any drawback.

Granted, that habit of Windows and Linux partitioning tools looses at most 0.012% of the space. But: what is the rationale?

fgrieu
  • 856

1 Answers1

3

The area preceding the first partition is used for the MBR itself, which starts with the Bootstrap code area and terminates with a Boot signature (hex 55AA).

As the MBR points to all the following partitions, including the first, that first partition can be at any offset from the MBR with no ill effect. This is why different operating systems can choose any offset they like for this partition, with indeed no drawback.

This area before the first partition is also known as hidden sectors, which are sectors on a drive that don't belong to a partition.

OS X apparently went its own way, but Linux chose to follow Windows as regarding the offset of the first partition. So why did Microsoft choose this value?

The first Microsoft document describing why the offset value of 1048576 was chosen is today found only on the WayBack Machine article Windows Vista support for large-sector hard disk drives, where it says:

The file system, the volume manager, and other parts of the storage stack in Windows Vista have been updated to accommodate hard disk drives that have a large sector size. In earlier versions of Windows, the default starting offset for the first partition on a hard disk drive was sector 0x3F. Because this starting offset was an odd number, it could cause performance issues on large-sector drives because of misalignment between the partition and the physical sectors. In Windows Vista, the default starting offset will generally be sector 0x800.

Note that 0x800 sectors of 512 bytes (size of sector before large-sector disks) gives exactly 1048576 bytes.

Microsoft engineers chose a starting offset that should give an even number of sectors for any large-sector drive that manufacturers could produce. This was required on large-sector drives because misalignment between the size of a physical sector and the partition(s) would have caused performance issues.

Microsoft could have picked an offset of any even number of sectors divisible by the size of a new large-sector to solve any misalignment issue. They could have picked an offset of 32, 64 or even 128 KiB, but they chose 1 MiB.

Why? - I have no answer. It is just what they chose, probably with the idea that this would be large enough for any future large disk. In this they were right, since this amount is enough even for the larger disks of today that span terabytes.

harrymc
  • 498,455