Dual Booting/WiP

From postmarketOS
🚧 This page is a work-in-progress. Some information contained within may be inaccurate or incomplete.

To dual boot pmOS you need a boot method and a way to store data. After selecting both and following the guide, you will have a working device with dual boot.

For a lot of the methods, you will need pmbootstrap

How To Boot PMOS on android phones

Booting with a computer

This is the simplest option, but you will need a computer to boot pmOS. If used with an SD card to store data, then nothing is going to be modified on the phone.

After entering fastboot mode on your phone, run pmbootstrap flasher boot to start pmOS.

Recovery partition

NOTE: doing this will make you lose the android recovery mode.

If the pmOS kernel is written to the recovery partition, then your device will boot into pmOS when you enter recovery mode. You can get the image of the kernel by running pmbootstrap export. And fastboot flash recovery /tmp/postmarketOS-export/boot.img to flash it to recovery.

A/B slots

On phones that have A/B slots, you can flash pmOS to slot B, and leave slot A for android.

Switching slots can be done with a computer using fastboot --set-active=[a/b] while the phone is in fastboot mode.

Alternatively, you can use Switch My Slot on Android to switch to pmOS.

On pmOS you can use qbootctl to switch back to Android.



On the Nokia N900 and other devices that use U-boot (like MangoPi MQ-Pro (mangopi-mq-pro), Xunlong Orange Pi 3 (xunlong-orangepi3)), U-boot provides a mechanism to select the OS. See Nokia N900#Installation and bootmenu on U-boot doc

On some Amlogic devices with U-boot, there is a multi-boot mode: Amlogic#Boot process



On devices with lk2nd the boot image is loaded from an ext2 boot partition either on eMMC or SD card. Since lk2nd keeps backwards compatibility with android boot images, you can flash your android boot.img via lk2nd and it will boot that image unless an SD card with postmarketOS is inserted.

Where to store data


Some devices (like Pixel 3) use metadata encryption. This is not supported in pmOS. And will cause failure. Devices launched with Android 11 or higher have their metadata encrypted. To check if your phone has it run dmctl table userdata. If it outputs an error, then you can use stowaways.

for developers that want to fix it. There might be a way to remove it?

Read everything before doing anything. This only works on edge.

The end result is going to be that a folder(.stowaway/pmos/) in a partition will be used for root. This is useful for android devices where modifying the partition table is a crime.


To use this method, you will need to put files from root into a .stowaway/pmos/ on your phone. To transfer these files, we will use tar. And to boot with this method, you need to force pmOS to boot partition with the stowaway.

Here is a simple script that will make a pmos.tar and force booting to userdata.

# Note: This will only work on edge when !4386 is merged
pmbootstrap init

# Modify deviceinfo to force booting on userdata
pmbootstrap install --split
pmbootstrap shutdown
cd ~/.local/var/pmbootstrap/chroot_rootfs_*/
# Change userdata if you want to use a different partition
echo "deviceinfo_kernel_cmdline_append=\"pmos.stowaway pmos_root=/dev/disk/by-partlabel/userdata\"" | sudo tee -a etc/deviceinfo
sudo sed -i '3,0s/^/#/' etc/fstab # don't mount /boot
pmbootstrap install --split

# Make pmos.tar
pmbootstrap export
mkdir /tmp/PMOS_ROOT
sudo mount -o loop /tmp/postmarketOS-export/*-root.img /tmp/PMOS_ROOT
sudo mount -o loop /tmp/postmarketOS-export/*-boot.img /tmp/PMOS_ROOT/boot/
cd /tmp/PMOS_ROOT
sudo tar -cf ../pmos.tar *
cd /tmp
sudo umount /tmp/PMOS_ROOT/boot/
sudo umount /tmp/PMOS_ROOT

#fastboot flash boot /tmp/postmarketOS-export/boot.img

Flash command is commented out because, I don't want to override someone's android install

Unpacking pmos.tar on your phone

Now move /tmp/pmos.tar to your phone, using the command adb push /tmp/pmos.tar /sdcard

You will need root or TWRP for this part, run mkdir /data/.stowaways/pmos and mv /sdcard/pmos.tar /data/.stowaways/pmos. This will make a directory and move our tar into it. To unpack it, we need to run cd /data/.stowaways/pmos and tar -xf pmos.tar. Now we can remove pmos.tar with rm pmos.tar.

mkdir -p /data/.stowaways/pmos
mv /sdcard/pmos.tar /data/.stowaways/pmos
cd /data/.stowaways/pmos
tar -xf pmos.tar
rm pmos.tar

SD card

You can flash the file system to a SD card. Then pmOS will be able to use it.

pmbootstrap install
pmbootstrap export
# flash /tmp/postmarketOS-export/[device].img to SD card

See also