Writing a Raspbian Image to a Raspberry Pi from a Mac

Documenting my attempt to set up my raspberry pi as a CJDNS node. First things to happen was installing Rapsbian on the SDCard using raspberrypi.org.

Materials #

Steps #

  1. [Download a copy of raspbian](downloads.raspberrypi.org/raspbian_latest), this is the OS of choice for the raspberry pi.

  2. Unzip the file into your root directory.

  3. After the download is complete, run:

df -h

and take note of the listed devices.

  1. Connect the SD card reader with the SD card inside. Be sure the SD card is formatted as FAT32.

  2. Run df -h again and look for the newly added device. Record the device name of the SD card’s partition, for example, mine was /dev/disk3s1.

  3. To overwrite the disk, you must unmount the partition:

sudo diskutil unmount /dev/disk3s1
  1. Determine what the raw device name is with this formula: add ‘r’ onto the front of the device name and remove the partition qualifier (ie. s1) from the end. For example if the name of the partition you saw in step 5 was ‘/dev/disk3s1’, then the name of the raw disk will be ‘/dev/rdisk3’. Be very careful with this step. Accidentally choosing the wrong device name will result in you overwriting that device… like your computer’s hard drive.

  2. Use the following command to write the disk image to your SD card. Read the above step carefully to be sure you use the correct raw disk number here:

sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=<raw-disk-number>

If the above command reports an error (dd: bs: illegal numeric value), please change bs=1m to bs=1M.

Note that dd will not feedback any information until there is an error or it is finished; information will be shown and the disk will re-mount when complete. However if you wish to view the progress you can use ‘ctrl-T’; this generates SIGINFO, the status argument of your tty, and will display information on the process.

After the dd command finishes, eject the card:

sudo diskutil eject /dev/rdisk3

(or: open Disk Utility and eject the SD card)

Plug it into the raspberry pi, add a power source, keyboard, and screen and we’re on our way.

 
0
Kudos
 
0
Kudos

Now read this

Backing Up a Raspberry Pi Image to a Compressed Format on a Mac

Quick steps for backing up and zipping your Raspberry Pi image onto a Mac OS. There is a TL;DR at the bottom if you’re just looking for the commands. Having spent considerable time setting up and installing new software on my raspberry... Continue →