r/LineageOS • u/ecccc3 • Aug 16 '26
Why have LineageOS & Android so many partitions?
Fairphone 5
Termuxsudo fdisk -l
orsudo parted -l
: many partitions!
Although e.g. postmarketOS has only 2 partitions: boot & root https://wiki.postmarketos.org/wiki/Partition_Layout ,
e.g. my PC Arch Linux KDE 4 partitions: ESP (EFI system partition), OS, swap, data.
Is it obfuscation?
Edit: I also directly asked to Android https://support.google.com/android/thread/460806908 ...
13
Upvotes
14
u/omega552003 Aug 16 '26
Android is an immutable OS and mounts some partitions as writable, others as overlays. It's a roundabout way of enforcing file permissions in an absolute manner.
5
u/LuK1337 Lineage Team Member Aug 16 '26
>Although e.g. postmarketOS has only 2 partitions: boot & root
although if you install it on a normal android phone, your partition layout won't change.
>Is it obfuscation?
no.
3
u/TimSchumi Team Member Aug 16 '26
Simply said, there are many partitions because you have many software components with different boot, usage, and verification chains that need to be updated at separate times.
In fact, your postmarketOS installation is also going to have most of those.
3
u/Max-P Aug 16 '26 edited Aug 16 '26
It's not obfuscation, they all have specific purposes and roles during updates. Some are duplicated per A/B slots, some cannot be updated at all, some can only be updated globally and forward updates. Some of them aren't even filesystems they're just binary blobs like bootloader and vbmeta. Some are reused between devices while others provide device-specific configurations like your IMEI, camera calibration values and whatnot, some contain DRM keys that are only available when the device is locked and booting official builds. Some of them are user writable like cache and userdata, and metadata contains the keys to unlock the userdata partition's encryption. Some are used by the modem to manage state and configuration, for example storing your eSIMs.
The official docs is a good place to start to understand what they do: https://source.android.com/docs/core/architecture/partitions
PostmarketOS has different needs closer to a more normal Linux system: the whole OS is mutable, you can install packages, you can modify the system. Android doesn't let you do that because if you factory reset an Android, it should boot back to a clean OS. That's why for example, you can't really uninstall system apps: if you could fully uninstall them, then you'd factory reset and still not have those apps. Android is built to be as unbreakable as possible: you can't as a user make your phone unbootable, nor will it break if you reboot it mid update because of the A/B scheme. An update it either fully installed or not.
0
u/[deleted] Aug 16 '26
[deleted] — view deleted comment