How to Set Up a Raspberry Pi SD Card

Download Raspbian

Download the Raspbian OS

Take note of the file’s name and where it is saved.
Mine is: ~/Downloads/2016-05-27-raspbian-jessie.img

If you are using an SD Card adapter, check that it is not locked.
Raspberry Pis take Micro SD Cards, which will require an adapter to interface with your personal computer.

Note the little grey tab on the left side. In the first picture, the tab is down (locked). In the second picture, it is up (unlocked).

If you forget this step, you will receive Permission Denied errors during this setup.

Format the SD Card

Plug in the SD Card
Put the micro SD card into the SD card adapter, and connect it to your computer.

Get the identifier of the disk
$ diskutil list

In this example, the identifiers we care about are /dev/disk2 and /dev/disk2s1

screen-shot-2016-09-18-at-10-08-27-am

Erase it, format to FAT32, and name it “RASP”
$ sudo diskutil eraseDisk FAT32 RASP MBRFormat /dev/disk2
screen-shot-2016-09-18-at-10-13-56-am

Unmount the drive
diskutil unmount /dev/disk2s1
screen-shot-2016-09-18-at-10-15-53-am
(Note that our volume is now referred to as “RASP”.)

Write the Raspbian image to the SD Card

$ sudo dd if=~/Downloads/2016-05-27-raspbian-jessie.img of=/dev/rdisk2 bs=1m

Note! Here, we refer to the disk’s identifier as /dev/rdisk2. The “r” here means raw, and using it here will lead to a much faster process.

That’s it! You’re done. Put the SD Card in your Raspberry Pi and try it out.