Book Image

Raspberry Pi Gaming - Second Edition

By : Shea Silverman
Book Image

Raspberry Pi Gaming - Second Edition

By: Shea Silverman

Overview of this book

Table of Contents (16 chapters)

Setting up an SD card


The Raspberry Pi uses SD cards to contain its operating system and main storage space. A Raspberry Pi SD card contains two partitions, which are explained as follows:

  • The first one, is the boot partition. This space contains the Linux kernel, required boot up files, and most importantly, the config.txt file. This file allows you to change the boot time parameters and customize some of the functions of the Raspberry Pi. These options include over-clocking the device, changing monitor settings, and the memory split between CPU and GPU, among numerous other options.

  • The second partition contains a Linux partition, which holds all of your applications, configurations, and operating system files.

Preloaded SD card images are available, which make it quick and easy to get your Raspberry Pi up and running.

Choosing an SD card is an important step. There are many different combinations of card sizes and card speeds. 4 GB is the minimum size required for many of the operating systems (OS). I recommend that you start out with an 8 GB card. You will also see cards marked with Class 4, Class 6, and Class 10. This is the speed at which the card can be read and written to. I have found that the best bang for the buck is a Class 6 card, but don't worry too much about which one you choose.

Before we begin, you will need to download a suitable Raspberry Pi OS. We will be using the official operating system called Raspbian. You can download it from

http://www.raspberrypi.org/downloads.

Note

Warning! dd and Win32DiskImager can be used to overwrite your computer's own hard drive or other drives connected to your computer. Double and triple check that the drive you select is your SD card.

Creating the SD card in Windows

To create the SD card in Windows, you will need to download the program called Win32DiskImager by visiting http://sourceforge.net/projects/win32diskimager/.

Once you are done with the downloading, perform the following steps:

  1. Unzip the Raspbian image by double-clicking on the Raspbian.zip file.

  2. Select a place on your hard drive to save the extracted file.

  3. Click on Extract files….

  4. Insert the SD card into your computer's SD card reader.

  5. Run Win32 Disk Imager.

  6. Select the Raspberry Pi image on your hard drive.

  7. Select the drive letter under the device that corresponds to the SD card.

  8. Click on Write.

Creating the SD card in Macintosh OS X

OS X includes everything you need to create the SD card out of the box. We will use a utility called dd:

  1. Double-click the Raspbian image ZIP file. It will automatically extract into the same place as the ZIP file.

  2. Insert the SD card into your computer's SD card reader.

  3. Open the terminal application (located in the Applications | Utilities folder).

  4. Find the name of your SD card by typing diskutil list.

  5. Unmount your SD card by typing disktuil umountdisk <disk>, that is, /dev/disk2.

  6. Copy the OS image from your hard drive to the SD card by typing dd if=/path/to/os/image.img of=<disk> where <disk> is /dev/disk2, and path/to/os/image.img is the place to which you saved the image.

  7. It can take anywhere from 15 minutes to over an hour for the image to be written to the SD card. It will look like nothing is happening until it finishes copying. When it is done, you will see a message showing how long it took to transfer in seconds.

    Tip

    You can press Ctrl + T at any time to see the current status.

Creating the SD card in Linux

Like OS X, Linux includes everything you need out of the box:

  1. Insert the SD card into your computer's SD card reader.

  2. Using the terminal of your system, find the name of your SD card by typing sudo fdisk –l.

  3. If required, you can unmount your SD card by typing umount <disk> (which will be listed from the earlier command , IE/dev/disk2).

  4. Copy the OS image on your hard drive to the SD card by typing dd if=/path/to/os/image.img of=<disk>.

Now that you have created your Raspberry Pi SD card, it's time to set up our device!

Using NOOBS

The Raspberry Pi Foundation has created a piece of software called New Out Of the Box Software, often abbreviated as NOOBS. This is a small operating system, which is used to install other OSs onto your Raspberry Pi.

Installing NOOBS is much easier than other installs:

  1. Download NOOBS from http://www.raspberrypi.org/downloads and unzip the file.

  2. Insert the SD card into your computer's SD card reader.

  3. Drag and drop the NOOBS files onto the SD card and you are done!

At the first boot, you will be presented with a list of OSs available to be installed. Choose Raspbian and press Enter.