11

There is much talk of Android partitions that can be found with Google. Sometimes I can find references to GPT in documentation for mobile processors or on XDA Developers (where I have learned that certain devices do use GPT as their scheme). Aside from that, there is not much discussion about what Android devices use for storing partition information. There are exceptions: I know some devices use the MTD subsystem's command line-based method, like some of HTC's earlier devices, and I know that Qualcomm devices seem to use a GUID Partition Table.

If a device's partitions are represented by device nodes starting with mtd or mtdblock, then Linux receives the partition information from the boot arguments. If the partitions are represented by device nodes beginning with mmcblk, then the partition scheme is ambiguous. It could be using a GUID Partition Table, but the problem is that the table would have to start at the first sector which is also where all first-stage bootloaders reside in my experience.

Just as partition information on devices whose partitions' nodes begin with mtd can be found in /proc/mtd, on devices where the device nodes begin with mmcblk, the same information can (usually) be found at /proc/emmc. Why eMMC, a type of storage device, is treated like an alternative to MTD, which is an interface for accessing flash storage, I don't know. But this page on GitHub seems to imply that the partition information for devices with /proc/emmc is not gathered a table like GPT.

That same page seems to also be saying that kernels booted by U-Boot expose partitions in a different manner than MTD or GPT. Here is the passage:

Since MTK devices use the uboot mechanism, partitions including boot and recovery, are not revealed as separate partitions, but rather accessed sequencially by size and start parameters.

That sentence is rendered meaningless to me by the bit about sequential access. Perhaps someone can explain it better.

So how common is the GPT on Android devices? I've not seen any reference to partitioning on the Android developer website. If bootloaders are actually stored after the partition table, then does that mean the chips are GPT-aware?

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
Melab
  • 855
  • 4
  • 15
  • 27

1 Answers1

5

If I'm not wrong, GPT is pretty common. It's pretty advanced format than MBR. On my KitKat, they have 36 partitions. GPT has features like a backup partition table and naming/flag, and supports larger disks than MBR. (Android 6.0 introduces the ability to adopt external storage media which uses GPT as default partition format.)

A device may or may be aware of GPT. Typically with MBR, the first 512 bytes are used for the partition table. When we use GPT, it doesn't store any data on 1st sector. Instead, it gets marked as a protective MBR, so that if the device looking for MBR complaints, there is no partition.

If you are interested in the in-depth document:

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
lakshmipathi
  • 211
  • 2
  • 8