Skip to content

Instantly share code, notes, and snippets.

@northband
Created October 7, 2013 16:20
Show Gist options
  • Save northband/6870668 to your computer and use it in GitHub Desktop.
Save northband/6870668 to your computer and use it in GitHub Desktop.
How to load up OS 'Rasbian' onto an SD card via *nix. I use OSX but this should work on linux as well with maybe a couple changes if any.
1. Download the image from a mirror or torrent http://www.raspberrypi.org/downloads
2. Verify if the the hash key is the same (optional), in the terminal run:
shasum ~/Downloads/2012-12-16-wheezy-raspbian.zip
3. Extract the image:
unzip ~/Downloads/2012-12-16-wheezy-raspbian.zip
4. From the terminal run:
df -h
5. Connect the SD card reader with the SD card inside
Run df -h again and look for the new device that wasn't listed last time.
Record the device name of the filesystem's partition, for example, /dev/disk3s1
6. Unmount the partition so that you will be allowed to overwrite the disk:
sudo diskutil unmount /dev/disk3s1
7. Using the device name of the partition work out the raw device name for the entire disk, by omitting the final "s1" and replacing "disk" with "rdisk" (this is very important: you will lose all data on the hard drive on your computer if you get the wrong device name).
Make sure the device name is the name of the whole SD card as described above, not just a partition of it (for example, rdisk3, not rdisk3s1. Similarly you might have another SD drive name/number like rdisk2 or rdisk4, etc. -- recheck by using the df -h command both before & after you insert your SD card reader into your Mac if you have any doubts!):
For example, /dev/disk3s1 => /dev/rdisk3
In the terminal write the image to the card with this command, using the raw disk device name from above (read carefully the above step, to be sure you use the correct rdisk# here!):
sudo dd bs=1m if=~/Downloads/2012-10-28-wheezy-raspbian/2012-12-16-wheezy-raspbian.img of=/dev/rdisk3
If the above command report 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 show and disk will re-mount when complete. However if you are curious as to the progresss - ctrl-T (SIGINFO, the status argument of your tty) will display some en-route statistics).
8. After the dd command finishes, eject the card:
sudo diskutil eject /dev/rdisk3
(or: open Disk Utility and eject the SD card)
9. Insert it in the Raspberry Pi, and have fun (Mac) The RasPiWrite utility is a python script which will walk you through the process of installing to SD card, it works with any Raspberry Pi compatible disk image, and can download one of the currently available distros if you don't have one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment