0

If a disk uses GPT partitioning method, is its first sector still called MBR? What is a generic name for the sector which stores the partition table of a disk? Thanks.

Tim
  • 101,790
  • Sure. Just spent a pleasant second with a defender of bureaucracy – Tim Feb 20 '19 at 17:49
  • 4
    I'm voting to close this question as off-topic because it's "not directly related to Unix or Linux" as per the U&L tour for on/off-topic guidelines. – Jeff Schaller Feb 20 '19 at 17:59
  • Apart from one quite limited case of only one partitioning scheme, that studiously ignores supplementary information that has been fairly common in that scheme since the early 1990s, no partition table is stored in a single sector. This question is based upon a fallacious premise. – JdeBP Feb 20 '19 at 18:34
  • @JdeBP Thanks, but what do you mean by "no partition table is stored in a single sector"? – Tim Feb 20 '19 at 18:37
  • (Perhaps two. An unencapsulated BSD disc label is another such case, but I'd argue that that is also a quite narrow and rare circumstance.) – JdeBP Feb 20 '19 at 18:45
  • @JdeBP are you replying to me, or yourself? – Tim Feb 20 '19 at 18:47
  • A DOS "partition table" with more than 4 partitions (ie. with logical partitions) is actually a linked list of partition tables with its nodes stored across the whole disk. Since the "DOS" partitioning was never formally documented (you'll have to read the source code of windows nt, linux, fdisk, etc), there are a lot of entrenched urban myths about it, and it is quite offtopic here, it's better to let it die in peace ;-) Use gpt for all new installations. –  Feb 20 '19 at 19:05
  • "Is A called B?" Is never a good question. What you should care is what does A look like, not the name of A. Names might change in the future or refer to different things depending on the context. For what does GPT look like, I think Wikipedia has explained it very well. – 炸鱼薯条德里克 Feb 21 '19 at 09:04

1 Answers1

2

A GPT partitioned disk still has a legacy MBR that is typically used to store a "Protective MBR", containing an old-fashioned partition table defining a single partition of type EE spanning the whole disk (up to 2 TB). The purpose of this entry is to tell old tools that don't understand GPT that there is no free space on the disk, hopefully preventing the creation of legacy partitions on the disk. The MBR also contains boot code, if the firmware confirms to the legacy BIOS interface instead of UEFI.

After the MBR (Linear Block Address 1) comes the Primary GPT Header, a sector containing miscellaneous data, for example the LBA of the start of the real GPT partition table (usually LBA 2).

The GPT partition partition table spans several sectors, typically 32, but can be larger or smaller; the size is defined in the GPT Header.

Johan Myréen
  • 13,168
  • Thanks. "The MBR also contains boot code, if the firmware confirms to the legacy BIOS interface instead of UEFI." If the firmware is UEFI, what does the MBR contain, and where is boot code stored? – Tim Feb 20 '19 at 20:57
  • If the firmwares is UEFI then, apart from the Protective MBR, it doesn't matter what the MBR contains. In this case, the firmware is able to read files on the special EFI System Partition, and can execute these files. – Johan Myréen Feb 21 '19 at 05:25
  • Is the sector(s) which stores the partition table of a disk called disk label? Also see https://unix.stackexchange.com/questions/503241/what-does-disk-label-mean – Tim Feb 27 '19 at 01:51