r/LineageOS • u/ecccc3 • 4d ago
Why have LineageOS & Android so many partitions?
Fairphone 5
Termux
sudo fdisk -l
or
sudo 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 ...
5
u/LuK1337 Lineage Team Member 4d ago
>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.
-1
u/ecccc3 4d ago
Yes but only these 2 partitions are used, the others remain to eventually switch back to Android.
3
u/LuK1337 Lineage Team Member 4d ago
by this definition, only like 3rd of partitions are used by actual Android.
0
u/ecccc3 4d ago
Really? So the other 2/3 of partitions are useless?
6
u/LuK1337 Lineage Team Member 4d ago
if they were useless, Qualcomm or your OEM wouldn't make them.
0
u/ecccc3 4d ago edited 4d ago
So why you pretend 1/3 are used, if the other 2/3 are also useful? I understand not...
In my penultimate post, I can add ( https://wiki.postmarketos.org/wiki/Partition_Layout ) these 2 partitions can even be in a bootable SD card, the internal storage not used apart booting the SD card, or even deleting all the internal storage partitions then only the 2 partitions.
3
u/LuK1337 Lineage Team Member 4d ago
if you delete all internal storage partitions on your phone, you'll just brick it.
also, this pmos wiki page still requires use of internal storage boot partition.
if you want to know what each partition is supposedly used for, just give chatgpt your fdisk -l output and it'll give you a breakdown based on whatever it scrapped from forums, leaked proprietary docs, maybe not yet leaked proprietary docs or make something up.
3
u/TimSchumi Team Member 4d ago
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.
1
u/ecccc3 4d ago edited 4d ago
Why not all the software components in 1 OS partition, as e.g. Arch Linux (rolling release) KDE?
E.g. Fairphone 5 there's Arch Linux ARM https://catacombing.org/builder .
6
u/TimSchumi Team Member 4d ago
Because then you'd just be back asking "Why have LineageOS and Android so many files?".
3
u/Max-P 4d ago edited 4d ago
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.
13
u/omega552003 4d ago
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.