Chris Elleman Technical Stuff

4 Jun/12 Off

Raspberry Pi - The first 48 hours

My raspberry pi arrived! After waiting 9 months, its finally here, posted this pic on facebook, got some virtual high-5s from friends, all systems are go:

I'd got myself prepared, bought a nice large 8Gb SD card, got a 5V 600mw Phone Charger, HDMI->VGA cable, wireless keyboard with built-in track pad.

All commands are run as root (sudo bash).

Step 1 - Find Some Instructions

Quick Google Search and found this PDF.

Downloaded the Debian Squeeze Image from this page, along Win32DiskImager utility so I could load it on from my Windows 7 PC.

Step 2 - Prepare the SD card

Put the image on the SD card, using the Win32DiskImager utility, all was looking good, was only using 2 of the 8Gb space on the SD card, but to be honest it didn't matter, just wanted to get something running.

Step 3 - First switch on

Plugged everything into the Pi, started to get excited, finally added the power and it sprunk into life, could see the LEDs flashing and something was happening, watching my DHCP logs I could see that it was asking for a LAN address, eventually the OK light came on, but nothing was on my VGA screen - how strange! Tried another VGA screen, still nothing, plugged into my TV and at last saw the console - ITS ALIVE.

After some research I found that to convert from HDMI->VGA is no small task and the cable I had bought wasn't up to the job, so instead I bought an HDMI->DVI cable and this worked a hell of a lot better, so I could use a monitor and not interupt my wife or the kids TV viewing.

Step 4 - Using the Pi

My first impressions, to be honest, were very underwhelming, I knew it had a 700MHz processor and only 256Mb RAM, but I was expecting it to be bit quicker - it was painfully slow.

When I was wget'ing a file from, I was only getting 200Kbps, on my 100Mbit cable connection! Loading into XWindows, programs were taking 30secs to 1min to start u with the processor getting hammered, the midori broweser was particularly bad, something needed to be done.

Step 5 - Optimisation - from SD to USB

Reading the forums and thinking about the problem I came to the conclusion that the SD card was doing me no favours in the performance department, so I decided to move to using a USB Stick instead. I had a 4Gb one which I had as conference swag from some event or another. With a Raspberry Pi you have to boot from SD due to the lack of bios.

I managed to find this post, which gave some good instructions, however, there were a few gaps, firstly, I had to remove all partitions from the USB Stick for the Win32DiskImager to work properly, que fdisk on my linux box, I deleted all partitions off the USB stick, then used Win32DiskImager to write the original debian squeeze image onto the USB stick, this creates the same partitions as the SD card.

On the boot SD card, I edited the /boot/cmdline.txt file and changed the following setting, from:




I also had to replace the /boot/kernel.img with the one from here:

I restarted the Pi, it went through a re-initialisation process (as effectivly it was a new image), but this gave an immediate speed benefit, the system was now at least usable.I then turned on the swap space on the usb stick, by adding the following entry to /etc/fstab (on the new usb root filesystem):

/dev/sda3  none           swap    sw              0       0

As this was starting again, I had to update the debian repositories again:

apt-get update  # had to run this twice

The final step was to ensure that the kernel/firmware was completely up-to-date, using rpi-update tool on the Pi itself.

This brought me very close on the disk space front, so I had to so something quick to sort this out

Step 6 - Optimisation - using all the space

As the debian image is a 2Gb image, all paritions are sized accordingly, my USB Stick is 4Gb, so I have double the space, this leaves me couple of options:

  1. extend the partitions - this is where you can delete some of the shipped partitions and re-allocate using using fdisk, but this needs a linux system and can be a pain.
  2. use the remaining space as another partition - this is where you find the biggest directory and move it to a new partition

I chose option 2, I created a new partition in the remaing unallocated space on the usb stick (rebooted to pick up the new partition table), formatted as ext4 (mkfs.ext4 /dev/sda4). Doing a "du -sk /*", identified /usr as the largest partition, so I copied it to the new partition (mount /dev/sda4 /mnt; cd /usr; cp -Rp * /mnt/; cd /), renamed the original (mv /usr /usr1; mkdir /usr), and added the following to /etc/fstab:

/dev/sda4       /usr           ext4    defaults        0       0

I then "sync"'d the filesystems and pulled the power rather than doing a normal shutdown, on the next reboot, /usr was now running off the new partition, so I deleted the /usr1 directory.

This gave me much more space and a performant platform to build on.

Step 7 - Some useful utilises

As usual, its always good to get some utilities:

  • openssh-server - ssh server
  • screen - terminal virtual screen
apt-get install openssh-server screen

Step 8 - Running Video

One of the big draws of the Raspberry Pi compared to other small computing platforms, such as the SheevaPlug, which I also have is the ability to run a desktop and video, so I set to work finding that. A good post was here which described a deb package for omxplayer, I installed it, but also had to add the following line to /etc/profile:


Omxplayer can be run from either commandline, or from xwindows as it is purely using the GPU, and I must say that the result is awesome, it ran divx's, mp4's, and mkv's easily, in fact the CPU usage dropped off.


Was a shaky start, but after some perseverance, I've managed to get a platform which I can really start to play with. Reading other forum posts my problems aren't unique and I always have to bear in mind that we (as bleeding edge users and early adopters) are discovering the bugs, but this platform has a lot of promise.Next things to look at:

  • Quake 3
  • Flash player within a web-browser
  • Spotify Port - these is a linux version, but not for ARM
  • Xwindows hardware acceleration