Posted in Computing

Raspberry Pi, using different distros.

OK, I have been thinking of ways to switch between the three different distros that I am experimenting with on my RPi. Preferably without swapping SD Cards. This is my solution. I’m not suggesting this is the best way but it works for me.

First I got Debian working from an SD card. Then I connected a 250gb powered USB drive and partitioned it using gparted, as near as I could equally into 3. Formatting each partition ext4. This gave me /dev/sda1 (for Debian) /dev/sda2 (for Fedora) /dev/sda3 (for Raspbian)

Once I had copied the root filesystem for Debian to /dev/sda1, I changed the file /boot/cmdline.txt to allow Debian to use it, and rebooted. So far so good.

Next I booted from another SD card in with the Fedora distro on it and copied it’s root filesystem to /dev/sda2, changed the /boot/cmdline.txt to allow this SD card mount /dev/sda2 as root, and rebooted. This also works no problem

Finally I did the same with an SD card with Raspbian on it, i.e. copied the root filesystem to /dev/sda3, again after reboot all works OK.

One thing I did notice whilst the Fedora and Raspbian distros seem to notice when an SD card is inserted or removed the Debian distro does not, maybe someone can advise me if there is a way to fix this.

At this point I have got 3 SD Cards with 3 distros, all mounting a different rootfs from a USB hard drive.

Next how to get it all using 1 SD Card.
Currently I have setup small scripts on each distro to copy the contents of the /boot on the SD Card to a subdirectory, just in case it has been updated, and then replace the files in /boot with the ones I need depending on what distro I want. Not the most elegant way, but again it works for me. If anyone’s got a better idea I’ll gladly try it.

I hope this helps someone

Advertisements

2 thoughts on “Raspberry Pi, using different distros.

  1. BerryBoot
    Is the only multiboot raspberry tool i know, but it uses squashfs and loads each os froma separate container, not sure, how that works for performance wise, but it saves you having to swap /boot/config.txt /boot/cmdline.txt for each os and rebooting to load the next one.

  2. Thanks for this, i’m looking for a way to do this for a long time 🙂
    But… i’m new to linux, i’m new to raspberry pi and i dont really understand your steps to do this and i’m asking myself some questions… For example, where is root filesystem ? Or how can i change “the file /boot/cmdline.txt to allow Debian to use it” ? ^^ And the part “how to get it all using 1 SD Card” is really hard to understand for me 😉
    Could you write something like a tutorial with more details for beginners like me ?? 🙂
    (And sorry for my english, i’m french !)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s