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

Posted in Computing

My Raspberry Pi, one week on.

Well, I’ve had my Raspberry Pi for one week now………

…..and I love it.

The nostalgia that it evokes would have been enough for me, but it is also the challenge of getting various things working.

I had no initial setup problems, just imaged an SD Card with the Debian Squeeze distro, plugged in a keyboard, mouse, monitor, ethernet and power.  Booted up first time with no issues.

The first thing I did after booting was to update the firmware with the latest available.  To do this I used rpi-update from here.  After that I issued the two following commands.

apt-get update     {this command updates the package index files}

apt-get upgrade    {this command upgrades everything to the latest version}

After using the RPi for a couple of days like this I decided it was time to start trying a few things to improve the experience.  First on the list was Gnome.  Would it run and was it useable.  Well the answer is yeas and no.  It did run but not that fast, the CPU was maxing out almost continuously when trying to do the simplest tasks.  I tried a couple of things to give it a little more ompf.  Tried the different memory configurations, e.g. 224, 192, 128.  None of these made that much difference.

Next thing to try was creating a swap partition on a USB Flash Drive, but first I needed to get a suitable powered hub.  After referring to the elinux wiki, I found that my local PC World had this one in stock.

So £12.99 lighter, I plugged it in.  All seemed to work OK.  The only issue that I had was one that has been mentioned by a few, power being fed back into the RPi through the USB ports.  I decided to butcher an old USB extension lead and ‘cut the red wire’.  There are various thoughts on what is the best solution to this, I choose to ‘cut the red wire’ as I have limited knowledge of electronics, and cannot get my head around all the other explanations.

With the hub installed and working, it was time to setup the swap partition on the flash drive.  A very easy process, just used GParted to format the USB flash drive as a swap partition then selected Swapon.  The performance of Gnome was a little better but not enough.  So I decided to remove Gnome for now and just use LXDE.

Next thing to try was moving my rootfs to a USB external drive.  I just happen to have a 250gb one available.  Quite a simple task really, but I must admit I got some good pointers here.

Briefly.   Use Gparted to format drive to ext4, copy partition using rsync, edit cmdline.txt to point root to the new drive, in my case /dev/sda1.  The RPi is now booting from the SD card but mounts root from the USB drive.  I must say there is a vast improvement in performance now.  I may even give Gnome another try, although I suspect it is getting CPU bound so this may not help.  Roll on utilising the GPU.

Thanks to everyone at the RaspberryPi forum.  I haven’t posted much but I have learned a lot from reading about other peoples problems/ideas.