Dual booting Mobian and Android on Xiaomi Poco F1

πŸ‡ΉπŸ‡Ό δΈ­ζ–‡η‰ˆ

Linux mobile distro, such as postmarketOS, has more devices supported and more freedom. Instead of dual booting Windows and Android, why not dual boot Linux mobile distros and Android? This could be done on more Android devices.

There are many ways for dual booting Linux mobile distros and Android. For Xiaomi Pocohpne F1 here we have a stupid method: partition the internal storage and install Android and Mobain (Linux mobile distro) on it. Every time we want to boot to another OS, we just flash boot.img via TWRP.

This idea comes from “dual booting Windows 11 ARM and Android”. Renegade Project makes booting Windows 11 ARM possible on Snapdragon 845 phones. And we must partition the internal storage in order to boot Windows.

Now we could use the tools provided by Renegade Project to dual boot Mobian and Android. Or even more? Multi-booting Ubuntu touch + postmarketOS + Mobian + Arch Linux ARM + Windows + Andorid ! Just make sure you have eonugh spaces left on device.

1. Install TWRP

  1. Install Fastboot tool on your PC.

  2. Boot into fastboot mode. Connect the phone to your PC. Download TWRP for beryllium and flash it:

1
fastboot flash recovery  twrp-3.6.2_9-0-beryllium.img

2. Partitioning the internal storage

  1. Install ADB tools on your PC.

  2. Download GNU parted from Renegade Project.

  3. Connect the phone to your pc.

  4. Boot into TWRP. Send parted to the phone and correct permissions:

1
2
3
4
adb push parted /sdcard
adb shell
cp /sdcard/parted /sbin/
chmod 755 /sbin/parted
  1. Start partitioning the internal storage:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
umount /data
umount /sdcard
parted /dev/block/sda
# Print partition layout
print
# Resize userdata (where Android is installed) to 64GB
resizepart 21 64GB
# Create a parition for Mobian
mkpart mobian ext4 64GB 123GB
quit
exit
  1. Reboot to TWRP again. Create file systems for Android and Mobian:
1
2
3
4
adb shell
mke2fs -t ext4 /dev/block/by-name/userdata
mkfs.ext4 /dev/block/by-name/mobian
exit

Now we could start installing Android and Mobian.

3. Install OS to the phone

  1. Download LineageOS builds from the official website

  2. Click Advanced β†’ ADB Sideload in TWRP. Flash Android ROM. Dont’t forget to preserve boot.img from Lineage OS ROM archive.

1
adb sideload lineageos.zip
  1. Download Mobian weekly builds

  2. Boot into fastboot mode. Flash the boot.img:

1
fastboot -S 100M flash boot mobian-boot.img
  1. Flash the rootfs to mobian partition. Also remember to preserve boot.img from Mobian archive.
1
2
fastboot -S 100M flash mobian mobian-rootfs.img
fastboot erase dtbo

4. Steps for dual-booting

Boot into TWRP. Save boot.img of Mobian and boot.img of Android to Android’s internal storage (/sdcard1) because TWRP could only mount Android partitions.

Note there are some decryption issues on Android 12+ TWRP, so you could also save boot.img to external sdcard, or flash it via fastboot.

When we want to boot into Android, click Install in TWRP and click Install images, flash Android’s boot.img to boot partition in TWRP and reboot. The steps are the same for Mobian.

Finally, you will need to backup boot.img again after upgrading Android or Mobian systems.

5. Final words

Why is this stupid? Because Renegade project developers are developing a boot menu for dual booting Android and Windows 11. Sadly it may not work for Linux mobile distros.

What’s more, I would like to replace Android with Ubuntu touch because most things (including camera) work on it, also Waydroid is available on UT. It could be used as a daily driver. However, Mobian and postmarketOS is much like “the real mobile Linux” in compred to locked-down UT.


Thanks for your reading. You are welcome to share articles of Ivon's Blog (ivonblog.com). Please include the original URL when reprinting or citing articles, and abide by CC BY-NC-ND 4.0 license. For commercial use, please write an e-mail to me.

written by human, not by AI

If this article is helpful to you please consider supporting me.

Leave a comment

Choose the commenting system you like.

Please login to your Github account to leave a comment. You can post codes here for discussion. For images, please upload to Imgur and copy links. Your comments would be visible to everyone on Github Discussions.

This comment system is provided by Disqus, you may see some Disqus ADs on this page. You can leave a comment anonymously but you won't receive reply notifications.