Installing Raspbmc To an SD Card Using the dd Command

Installing Raspbmc To an SD Card Using the dd Command

Get a new Raspberry Pi? I bet you are more than eager to get it up and running.. here are a few tips to help you along your way.

This goes with the assumption that you are running a mac or linux machine, if you are running PC, your steps will differ. Anyway let's get to work!

First step, download the latest raspbmc zip from here http://www.raspberrypi.org/downloads/. Then, run the gunzip command from the command line to unzip the image.

# gunzip ./pathToFile
gunzip ~/Downloads/raspbmc-2014-11-24.img.gz

Second step, insert the SD card into your computer. You will likely need an SD card adapter to do this. Once you have inserted your SD card, from the terminal run the following commands to inspect the device.

diskutil list
df -h
 
# this was my sd card
# /dev/disk2s5 - system
# /dev/disk2s7 - boot
# /dev/disk2s1 - recovery

If you are unsure which device is your SD card, try ejecting the SD card and running the previously mentioned commands before and after inserting it again. For me, I noticed the device added was /dev/disk2. Take note of this disk number.

Once you have determined which disk# your SD card is (disk2, disk3, etc.) you are ready to unmount it and run the disk destroyer command. FYI unmounting is not the same as ejecting the device in finder.

# diskutil unmountDisk /dev/sdCardDisk#
diskutil unmountDisk /dev/disk#

And finally run the dd command

# syntax: sudo dd bs=2M if=/path/to/image of=/dev/disk#
# specify rdisk# to write the image much faster
sudo dd bs=1m if=raspbmc-2014-11-24.img of=/dev/rdisk#

For more information on rdisk and dd command see:
http://elinux.org/RPi_Easy_SD_Card_Setup
http://www.raspberrypi.org/documentation/installation/installing-images/mac.md