Raspberry PI can support many Linux versions optimised for the ARM processor that’s built into the motherboard. Many of those versions are derived from the most popular PC versions – for example “Pidora” from Fedora, or “Raspbian” from Debian. The project website contains a list of available Linux versions for Raspberry PI.
In the previous articles we covered how to get your Raspberry PI and how to set it up. It is now time to install the operating system. We at 2ndQuadrant Italia are particularly fond of Debian systems. We downloaded then the Raspbian version: from the official site linked above it is possible to download a zip file containing the image of a Linux Debian 7.0 wheezy, optimised to work with the ARM architecture. This operation should be done from another PC, with an SD reader port to copy the unzipped image of the operating system into the SD card.
Be aware that a simple copy of the image on the SD disk is not enough: it already includes a preliminary partition where
/ and operating system are stored, so it cannot be copied inside a particular preexisting partition of the SD card. Below some key-steps for the installation are listed.
In order to transfer the Raspbian image on the SD card, we have used a PC with Ubuntu as operating system. Our PC did not have a SD reader, so we used an external USB SD reader (if this is your case too, remember to insert the SD card into the USB reader before plugging it into the USB port). Here follows a summary of the tasks we did:
- Download the zip file containing the image from the Raspberry PI repository
- Optionally, verify that the hash key of the zip file is the same as shown on the downloads page using the
- Extract the image with the
- Insert the SD card into the SD reader port. To find the name of the device, run the
dfcommand before and after inserting the SD card. The device that wasn’t present the first time identifies your SD card. Note that the SD card can show up more than once in the output of the
dfcommand (the device name of SD card will be listed with the last part indicating the partition number): in this case, as mentioned above, the partition of the device has to be unmount with the
umount /path/of/the/device/with/partitioncommand. If your SD card shows up more than once, you should unmount all of these partitions
- Make sure the device name is the name of the whole SD card as described above, not just a partition of it, relaunching the
dfcommand. Then, write the Raspbian image (.img file) into the SD with the
ddcommand. Something like:
dd bs=4M if=/path/to/raspbian.img of=/path/of/the/device.Block size set to 4M will work most of the time. If not, please try 1M – although 1M will take considerably longer
sync: this will ensure the write cache is flushed and that it is safe to unmount your SD card with the
Now it is possible to remove your SD card from the card reader and insert it in your Raspberry PI.
In the next post we will show you how to get started with it!