I want to modify the official Raspberry Pi OS lite image:

I want to add a secondary root partition to the image, so I can easily switch between 2 different operating systems.

Since I want to automate the modification of the image file, I cannot use any GUI/desktop program. My Raspberry is not connected to a display so I cannot use any fancy boot manager either (no Berryboot, PINN). Also I don't want to manually calculate partition sectors, sizes.

What is the common approach to automate the modification of a Raspberry OS image to have dual root partitions?


1 Answer 1


The Pi will only boot from the first partition on the storage medium.

It is possible to have multiple root partitions (provided they have the same kernel).

PINN installs a minimal OS which then boots selected OS.

To use a different root partition just edit root=PARTUUID=… entry in cmdline.txt.
You also need to edit /etc/fstab on the new root to mount the correct root.

PARTUUID=…  /               ext4    defaults,noatime  0       1
  • Thanks, I didn't know that. That means I will have to modify /boot when switching between multiple systems. I updated the question so it only asks for how to add a secondary root partition Commented Jun 22, 2023 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.