Operation Manual
purchased one of these, or received it in a bundle with your Pi, you can simply plug it in to the SD card slot on the bottom side of the left-hand edge. If not,
you’ll need to install an operating system—known as flashing—onto the card before it’s ready to go.
Some SD cards work better than others, with some models refusing to work at all with the Raspberry Pi. For an up-to-date list of SD card models known to
work with the Pi, visit the eLinux Wiki page: http://www.elinux.org/RPi_VerifiedPeripherals#SD_cards
Flashing the SD Card
To prepare a blank SD card for use with the Raspberry Pi, you’ll need to flash an operating system onto the card. While this is
slightly more complicated than simply dragging and dropping files onto the card, it shouldn’t take more than a few minutes to
complete.
Firstly, you’ll need to decide which Linux distribution you would like to use with your Raspberry Pi. Each has its advantages and
disadvantages. Don’t worry if you change your mind later and want to try a different version of Linux: an SD card can be flashed
again with a new operating system at any point.
The most up-to-date list of Linux releases compatible with the Pi is available from the Raspberry Pi website at
http://www.raspberrypi.org/downloads.
The Foundation provides BitTorrent links for each distribution. These are small files that can be used with BitTorrent software to
download the files from other users. Using these links is an efficient and fast way to distribute large files, and keeps the
Foundation’s download servers from becoming overloaded.
To use a BitTorrent link, you’ll need to have a compatible client installed. If you don’t already have a BitTorrent client installed,
download one and install it before trying to download the Raspberry Pi Linux distribution. One client for Windows, OS X and
Linux is µTorrent, available from http://www.utorrent.com/downloads.
Which distribution you choose to download is up to you. Instructions in the rest of the book will be based on the Debian
Raspberry Pi distribution, a good choice for beginners. Where possible, we’ll give you instructions for other distributions as well.
Linux distributions for the Raspberry Pi are provided as a single image file, compressed to make it faster to download. Once
you’ve downloaded the Zip archive (a compressed file, which takes less time to download than the uncompressed files would)
for your chosen distribution, you’ll need to decompress it somewhere on your system. In most operating systems, you can simply
double-click the file to open it, and then choose Extract or Unzip to retrieve the contents.
After you’ve decompressed the archive, you’ll end up with two separate files. The file ending in sha1 is a hash, which can be
used to verify that the download hasn’t been corrupted in transit. The file ending in img contains an exact copy of an SD card set
up by the distribution’s creators in a way that the Raspberry Pi understands. This is the file that needs to be flashed to the SD
card.
During the following, you’ll be using a software utility called dd. Used incorrectly dd will happily write the image to your main hard drive, erasing
your operating system and all your stored data. Make sure you read the instructions in each section thoroughly and note the device address of your
SD card carefully. Read twice, write once!
Flashing from Linux
If your current PC is running a variant of Linux already, you can use the dd command to write the contents of the image file out to
the SD card. This is a text-interface program operated from the command prompt, known as a terminal in Linux parlance.
Follow these steps to flash the SD card:
1. Open a terminal from your distribution’s applications menu.
2. Plug your blank SD card into a card reader connected to the PC.
3. Type sudo fdisk -l to see a list of disks. Find the SD card by its size, and note the device address (/dev/sdX, where
X is a letter identifying the storage device. Some systems with integrated SD card readers may use the alternative format
/dev/mmcblkX—if this is the case, remember to change the target in the following instructions accordingly).
4. Use cd to change to the directory with the .img file you extracted from the Zip archive.
5. Type sudo dd if=imagefilename.img of=/dev/sdX bs=2M to write the file imagefilename.img to the SD card
connected to the device address from step 3. Replace imagefilename.img with the actual name of the file extracted from the
Zip archive. This step takes a while, so be patient! During flashing, nothing will be shown on the screen until the process is
fully complete (see Figure 1-5).