Install Raspbian on Raspberry Pi

Raspbian “wheezy” is optimized version of Debian for Raspberry Pi. We will talk about how to install Raspbian on SD card so it is bootable on Raspberry Pi. This guide is almost identical with official wiki, but we will also upgrade firmware and run some comparison tests. We will do all the work in Linux terminal, if you are looking for graphical environment or Windows installer I suggest oficial wiki.

sha1sum ~/2013-02-09-wheezy-raspbian.zip

  • Unzip downloaded file

unzip ~/2013-02-09-wheezy-raspbian.zip

  • List mounted devices

df -h

  • Insert SD card to computer
  • List mounted devices again and notice which one is new

df -h

There should be new device, notice where it is mounted, for example: /dev/sdd

  • Disconnect all mounted partitions (if there is more of them, you have to repeat command for all of them) 

umount /dev/sdd1

  • with dd command move image to SD card. Run it as sudo

sudo dd bs=4M if=~/2013-02-09-wheezy-raspbian.img of=/dev/sdd

  • Make sure cache was cleared and remove the card

sudo sync

  • Insert SD cart to Raspberry Pi and let have some fun

It is handy to have monitor connected to Raspberry on first boot, because there will be setup screen where you can setup basic things. One of the useful things is to resign Raspbian partition to SD card size, or start SSH on boot, so we can connect to Raspberry later on without having it connected to monitor.

After login update all installed packages to newest versions.

apt-get update
apt-get upgrade

Lets do IO operations benchmark on SD card

pi@raspberrypi ~ $ dd if=/dev/zero of=~/test.tmp bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 49.9496 s, 10.5 MB/s
pi@raspberrypi ~ $ dd if=~/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out<br>524288000 bytes (524 MB) copied, 26.9565 s, 19.4 MB/s

Lets have a look at firmware version with command vcgencmd

pi@raspberrypi ~ $ vcgencmd version
Feb 7 2013 16:46:17 
Copyright (c) 2012 Broadcom
version 367974 (release)

Latest firmware is available on github: https://github.com/Hexxeh/rpi-firmware

sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
sudo rpi-update

Lets have a look at output with upgraded firmware, at the end…

pi@raspberrypi ~ $ vcgencmd version
Mar 4 2013 22:02:46 
Copyright (c) 2012 Broadcom
version 374489 (release)
pi@raspberrypi ~ $ dd if=/dev/zero of=~/test.tmp bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 45.1423 s, 11.6 MB/s
pi@raspberrypi ~ $ dd if=~/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 27.4592 s, 19.1 MB/s