First steps with a new Raspberry Pi

In this post:
1) Getting an Operation System
2) Burning the image downloaded to SD card.

There are different ways to install the Raspberry Pi, I will describe the one that I use.

1) Getting an Operation System:

– Go to Downloads page in the Raspberry Pi website:
– Select which one you want to burn in your Raspberry Pi -> I downloaded the RASPBIAN – Debian Wheezy

2) Burning the image downloaded to SD card.

What is your current Operation System? If you are working on:

– Linux: follow this guide: –
– Windows : follow this guide –
– MacOS : follow this guide –

In Linux (I followed this guide), there are different ways of doing this. The method used on the guide is under the command line with the command dd.
There is a special note to pay attention: “Please note that the use of the dd tool can overwrite any partition of your machine. If you specify the wrong device in the instructions below you could delete your primary Linux partition. Please be careful.”

In summary, on the Linux guide:
– Run df -h to see what devices are currently mounted.
– Insert the SD card, in your computer SD card slot.

– Run df -h again. The new device that has appeared is your SD card. The left column gives the device name of your SD card; it will be listed as something like /dev/mmcblk0p1 or /dev/sdd1. The last part (p1 or 1 respectively) is the partition number but you want to write to the whole SD card, not just one partition. Therefore you need to remove that part from the name (getting, for example, /dev/mmcblk0 or /dev/sdd) as the device for the whole SD card

– Now that you’ve noted what the device name is, you need to unmount it so that files can’t be read or written to the SD card while you are copying over the SD image.
– Run umount /dev/sdd1, replacing sdd1 with whatever your SD card’s device name is (including the partition number).
– If your SD card shows up more than once in the output of df due to having multiple partitions on the SD card, you should unmount all of these partitions.

– In the terminal, write the image to the card with the command below, making sure you replace the input file if= argument with the path to your .img file, and the /dev/sdd in the output file of= argument with the right device name. This is very important, as you will lose all data on the hard drive if you provide the wrong device name. Make sure the device name is the name of the whole SD card as described above, not just a partition of it; for example sdd, not sdds1 or sddp1; or mmcblk0, not mmcblk0p1.

dd bs=4M if=2015-02-16-raspbian-wheezy.img of=/dev/sdd

– Also note that if you are not logged in as root you will need to prefix this with sudo

– You can check what’s written to the SD card by dd-ing from the card back to another image on your hard disk, truncating the new image to the same size as the original, and then running diff (or md5sum) on those two images.
– The SD card might be bigger than the original image, and dd will make a copy of the whole card. We must therefore truncate the new image to the size of the original image. Make sure you replace the input file if= argument with the right device name. diff should report that the files are identical.

dd bs=4M if=/dev/sdd of=from-sd-card.img
truncate --reference 2015-02-16-raspbian-wheezy.img from-sd-card.img
diff -s from-sd-card.img 2015-02-16-raspbian-wheezy.img

– Run sync; this will ensure the write cache is flushed and that it is safe to unmount your SD card.
– Remove the SD card from the card reader.

Nice job! You have a SD card, with a ready Operation System to use on your PI 😉


  1. ailacomilang · · Reply

    Reblogged this on Aila Comilang and commented:
    In light of my recent purchase of the new Raspberry PI! This was hella handy!

    Liked by 1 person

    1. Glad that it was useful


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: