Raspberry Pi is a cheap and tiny single-board computer powered by ARM processor. While it was mainly developed for children to learn computer programming, it has also become a versatile device for DIY electronic enthusiasts or computer professionals who build many useful tools based on the tiny hardware.
Raspberry Pi comes in two different models with the following specifications.
- A model: 256 MB RAM, 1 USB port, no Ethernet port
- B model: 512 MB RAM, 2 USB ports, 1 Ethernet port (shown in the picture)
Raspberry PI uses an SD card as backing storage for an operating system and other tools. In this tutorial, I will describe how to write a Raspberry PI image to an SD card.
Raspberry Pi Images
There are several flavors of raw Raspberry PI images (e.g., Raspbian, Pidora, Risc OS, RaspBMC, Arch, and OpenElec) which you can download from Raspberry PI's official site. All these images are compatible with both model A and B.
The RaspBMC and OpenElec images are mainly used for multimedia purposes. With either image installed, Raspberry Pi can be turned into a tiny multimedia center. You can play movie files, audio files, watch online TV, etc.
The Raspbian, Pidora and Risc OS images are like regular operating systems for ARM processors. You can install any application or service on these operating systems, such as web server, file server, access point, etc.
The NOOBS image provides the easiest and most convenient way for you to write Raspberry Pi operating systems without worrying about manually flashing an image into an SD Card. It contains more than one Raspberry Pi operating systems. Upon first boot, NOOBS automatically formats an SD card, and asks you to choose an OS to install from a list.
In this article, I am going to use Raspbian image which based on Debian.
Prepare for Burning Raspbian Image to an SD Card
To burn a Raspbian image, it is recommended to use a class 10 SD card with minimum 4 GB storage.
Before starting the process, first download the Raspbian image from the official download page. The image comes as a zip file. Unzip the file to extract the Raspbian image file.
Burn Raspbian Image to an SD Card on Linux
Insert your SD card into the card reader.
First, you need to identify the device name for the SD card. For that, you can use Gparted. Launch Gparted, and you will see a drop-down disk selection menu in the top right corner which shows a list of hard drives. In this example, the SD card is mapped to "/dev/sdc". Make a note of this device name as you need it later.
You do not need to create or format any partition on the SD card. If there is already a partition or filesystem created on the SD card, it will be overwritten by dd command subsequently anyway.
If the SD card is mounted, make sure to unmount it now.
Finally, run the following dd command to write Raspberry Pi image to the SD card.
The "bs" argument sets the block size to 4 MB. Normally the "bs" argument will work with 4M, but you can change to 1M, which will take longer time to write. The "if" argument sets the full path to Raspbian image, and the "of" argument specifies the device name of the SD card. Here "/dev/sdc" is the device name you identified with Gparted earlier. Note that the dd command will not give you any feedback during its operation, and it will look like freezing. So be patient until writing is finished.
After the writing process is finished, eject the SD card. Plug in to the Raspberry Pi, and make sure that all the connections are ready (HDMI/TV out, keyboard, mouse, Ethernet cable). Finally, turn on the power.
Besides using dd command, you can also try other image writer applications such as usb-imagerwriter for deb based distributions, and imagewriter for rpm based distributions. These tools will make the image writing process more user-friendly than dd command.
Burn Raspbian Image to an SD Card on Windows
First, download and install SD Card Formatter from SD Associations.
Insert your SD card into the card reader, and then format the SD card with SD Card Formatter. Formatting options do not matter, as the formatted filesystem will be overwritten during the subsequent image writing step. The reason why we format the SD card is to make the card recognized by the operating system.
Next, download and install win32diskimager application which can flash an SD Card.
Launch win32diskimager. After locating the extracted Raspbian raw image via a built-in file dialog box, write the image to an SD card. It will take some times to finish writing the image into the SD card.
After the writing process is finished, eject the SD card and plug in to the Raspberry Pi.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.