Format Raspberry PI SD card on Mac OSX

So to get started with the Raspberry PI you will obviously need the board, a USB power cable and an SD card that you can format. I was actually considering using a USB pen instead although after some research that’s currently not supported, and the PI won’t boot without an SD card installed.

1. Download SD Card Image

You will need to download an SD card image with the operating system of your choice, you can get these from here. I would recomend downloading the debian based raspbian “wheezy” distro, it’s got a few enhancements just for the PI and comes with a few cool apps already installed, such as python. When the files downloaded dont forget to unzip so you have the raw .img file.

2. Insert SD card

Nice and simple, insert the SD card into your MAC. Next open up a terminal session to work out what the SD card has been called by your OS using the df -h command.

Last login: Thu Jul 26 21:34:38 on ttys002
Filesystem      Size   Used  Avail Capacity   iused    ifree %iused  Mounted on
/dev/disk0s2   931Gi  676Gi  255Gi    73% 177229112 66751630   73%   /
devfs          188Ki  188Ki    0Bi   100%       650        0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%         0        0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%         0        0  100%   /home
/dev/disk1       8Gi    1Mi  7.9Gi     1%       512        0  100%   /Volumes/Untitled

Hopefully you can see my 8GB SD card is showing as /dev/disk1, you will need that later on, ensure that you get the write filesystem otherwise you could format the wrong device.

3. Unmount the SD

The command for copying the .img won’t work while the device is mounted, run the following command first. Change the /dev/disk1 as required.

diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful

4. Copy your data!

Finally you can copy the .img file to your SD card using the ‘dd‘ command:

sudo dd bs=1m if=/Users/tom/Desktop/2012-07-15-wheezy-raspbian.img of=/dev/disk1

4. Copy your data!

Sit back and wait, the dd command will have to access all of the SD card. The larger and slower your card the longer it will take.

Once complete you should get a normal prompt back in your terminal window, be patient 🙂

Technology enthusiastic with many ongoing online projects one of which is this personal blog PingBin. While also working full time within a data center designing and maintaining the network infrastructure.

9 comments On Format Raspberry PI SD card on Mac OSX

Leave a reply:

Your email address will not be published.