How-to Write a disk image to a SDHC card

This brief document describes how to write a Raspberry Pi ARM disk image to a SDHC memory card on a Macintosh. Raspberry Pi boot images can be found from their download page: http://www.raspberrypi.org/downloads.

Raspberry Pi Downloads page
Raspberry Pi Downloads page

Due to the vast amount of traffic on the RasPi website’s download page, I would recommend either obtaining an image from using a BitTorrent client or downloading from a mirror site. Download mirror community sites can be found through the elinux RasPi website: http://elinux.org/RPi_Community. This example uses an ARM Debian 6 image from UK mirror site http://www.raspberrypidownload.co.uk/.

A RaspberryPi Download Mirror Site
A RaspberryPi Download Mirror Site

Select the Debian or other Linux distribution ARM image file you wish to download and save to your “Downloads” folder. Unzip the “debian6-17-02-2012.zip” file within a Finder window.

Insert a SDHC card which should mount to the desktop; you may need a card reader that can attach to a USB port. A 4 GB SDHC should be sufficient to store the Raspberry Pi disk image on.

SanDisk 4GB SDHC Memory Card
SanDisk 4GB SDHC Memory Card

Launch your Terminal application: “ApplicationsUtilitiesTerminal“.

Assuming the image has been downloaded to your user “Downloads” folder, the following commands can be typed at the Terminal prompt “%“:

% diskutil list

Identify the disk volume where the 4 GB SDHC card has been mounted, e.g.,

  • /dev/disk3
  • #:     TYPE NAME                                SIZE             IDENTIFIER
  • 0:     FDisk_partition_scheme        *4.0 GB        disk3
  • 1:      DOS_FAT_32 NO NAME         4.0 GB        disk3s1

Please note: to continue, you will require administrative (super-user) privileges.

Dismount the 4 GB SDHC disk; be careful not to dismount other disks you have on your computer, such as your “Macintosh HD” or “Time Machine” backup disk.

% sudo diskutil unmountDisk /dev/disk3

Write the disk image to the SDHC card.

% sudo dd if=/Users/<username>/Downloads/debian6-17-02-2012/debian6-17-02-2012.img of=/dev/disk3 bs=1m

Note: Please replace <username> with your login account’s username; this is the short-name which can be seen in the Terminal preceding the “%” or “$” prompt symbol.

The command prompt “%” will be left hanging during the writing operation and will appear once completed. The writing process could take between 10 – 30 minutes.

Below is an example of this process:

  • [macosx:~] mylogin% sudo diskutil unmountDisk /dev/disk3 
  • Unmount of all volumes on disk3 was successful
  • [macosx:~] mylogin% sudo dd if=/Users/mylogin/Downloads/debian6-17-02-2012/debian6-17-02-2012.img of=/dev/disk3 bs=1m
  • 1886+0 records in
  • 1886+0 records out
  • 1977614336 bytes transferred in 1785.959001 secs (1107312 bytes/sec)
  • [macosx:~] mylogin%

Once completed, the SDHC memory card can be ejected and the Terminal application can be closed.

SDHC memory card can now be inserted into your Raspberry Pi computer.

Advertisements