Partition Layout

A postmarketOS installation consists of two partitions, the boot and the root partition. This distinction was made to support FDE (full disk encryption). With FDE, the entire root partition gets encrypted, and the only non-encrypted part remains the boot partition (which does not hold any personal data).

Due to the wide range of devices we support, there are a few variations of where these partitions will be exactly after installing postmarketOS.

Use the whole storage device
Both partitions are directly written to the storage device (SD card, eMMC, ...), for example  and.

This is always done with SD cards. With the eMMC (internal storage), this is only done if it the factory OS can be flashed back without relying on a specific partitioning layout. (This is not possible with Android, see subpartitions below.)

A typical SD card installation:

A typical eMMC installation (you would flash the resulting image with a tool like Jumpdrive):

Subpartitions
Android (and other factory OS) require a specific partition layout. In order to make it feasible for the user to switch back to Android on their device, we install postmarketOS only into an existing partition. The postmarketOS boot and root partitions will become subpartitions of that partition.

For example, a typical Android installation consists of:
 * boot
 * system
 * userdata
 * (more partitions with firmware etc.)

postmarketOS will be installed into the system partition, which means the postmarketOS boot partition becomes  and the postmarketOS root partition becomes.

Example:

Note that the  command fills Android's boot partition with a boot.img file, that consists of the Linux kernel and initramfs from postmarketOS. The files are duplicated on the postmarketOS boot partition, but not used from there. Some Android devices have a strict size limit for this boot.img file, which is why we load additional files from the initramfs-extra file from the postmarketOS boot partition.

Pick a different subpartition
While on some devices, the system partition is bigger than the userdata partition, it is the other way around on others. So it is possible to switch to the userdata partition with. To clear a previous postmarketOS installation from the system partition, use  (otherwise, the initramfs may boot into the wrong installation!).

On-device installer
The on-device installer starts with three partitions (boot, reserved space, installer). It installs postmarketOS into the reserved space, and removes the third partition, so in the end it looks like the regular boot and root partition layout. Details are in the on-device installer article.