Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just ordered my Raspberry Pi, and I want to prepare my SD card. How do I install an OS image onto an SD card?

share|improve this question
FYI: It took ~30min for the image copy to complete with dd on OS X. – Tyler Aug 11 '12 at 21:22
@Tyler Yeah, it takes a while! I'm not sure that dd is the correct way to go on *nix systems. – Alex Chamberlain Aug 11 '12 at 21:28
up vote 22 down vote accepted

The process is pretty simple.

Download the image

First, go to the Raspberry Pi Foundation's Download page and download the image you want.

I suggest the Debian Squeeze image if you are an absolute beginner, but watch out for the Raspbian image soon as it should run faster. The Arch Linux image is great if you want a minimal install or if you've had a bit of experience with Linux before.

Verify the Download

The Raspberry Pi Foundaton provide the SHA-1 hash of the download, which we can use to verify the file was downloaded correctly and wasn't tampered with on the way.


You can use a utility provided by Microsoft called fciv or another provided by Frozen Logic called Summer Properties.


  1. Run sha1sum debian6-19-04-2012.zip. The generated hash should match the one given on the website; at the time of writing, it was 1852df83a11ee7083ca0e5f3fb41f93ecc59b1c8.

Extract the img file

Extract the .img file and remember where you put it.

I will assume your img file is called debian6-19-04-2012.img, and in the case of a Linux host, your PWD is the directory in which it is stored.


You can use unzip from the command line.


The installation differs depending on whether you are using a Linux or a Windows host to flash the image onto the card.


  1. Insert your SD card into your computer and note down the drive letter it is assigned.
  2. Download and install the Win32DiskImager.
  3. Select the image file you extracted earlier and the drive letter of the SD card.

Warning There is a significant risk you could damage your file system if you select the wrong drive letter. Make sure you get it right!

  1. Click "Write" and watch the pretty progress bar.


  1. Insert your SD card into your computer.
  2. Locate the device, by running sudo fdisk -l. It will probably be the only disk about the right size. Note down the device name; let us suppose it is /dev/sdx. If you are in any doubt, remove the card, run sudo fdisk -l again and note down what disks are there. Insert the SD card again, run sudo fdisk -l and it is the new disk.
  3. Unmount the partitions by running sudo umount /dev/sdx*. It may give an error saying the disk isn't mounted - that's fine.
  4. Copy the contents of the image file onto the SD card by running

    sudo dd bs=1M if=debian6-19-04-2012.img of=/dev/sdx

Warning There is a significant risk of damage to your filesystem if you use the wrong /dev/sdx. Make sure you get it right!

Have fun!

Once you have installed the OS eject the SD card properly and insert it into the Raspberry Pi. Attach power and enjoy.


  1. RPi Easy SD Card Setup
share|improve this answer
I like to use "Summer Properties" for calculating checksums in Windows. Integrates very nicely. frozenlogic.org/summerproperties.shtml – Kibbee Jul 4 '12 at 16:29
@Kibbee, That Summer Properties app is pretty awesome. – user606723 Jul 5 '12 at 19:41
Be sure to run sync after you're done to be sure that the image is written. – isaaclw Jun 15 '14 at 20:28
@isaaclw any suggestion on how one would use sync in this case? An example would be very helpful – Lucas Mar 20 at 1:06
@Lucas sync is a command you can run in your terminal. No options are needed. – isaaclw Mar 21 at 12:45

Modifications to above Linux process if using Mac OS X:

  1. Hook up the card.
  2. Go to Disk Utility.
  3. Make note of partition name
  4. Go to About this Mac
  5. Click System report
  6. Go to USB
  7. Find the partition name list
  8. Make note of BSD Name (example: disk1s1)
  9. Go to Terminal
  10. type: dd if=path_to_image_file of=/dev/BSD_Name noted in previous step
  11. Wait a LONG time

    or you skip step 10 and 11 and use sudo dd if=path_to_image_file of=/dev/rBSD_Name bs=1M (note the r before BSD_Name, it's supposed to be there!)

share|improve this answer
Doesn't /dev/disk1s1 refer to the first partition? – Alex Chamberlain Aug 10 '12 at 6:00
Welcome to Raspberry Pi, nice answer! I edited your original post trying to improve its legibility. If you want you can double-check if everything is ok now. – Avio Sep 29 '12 at 9:19
Also, bs=1m must be lowercase rendezvouswithpavan.wordpress.com/2015/06/16/… – Jason Oct 1 '15 at 4:36

I found myself doing this more often than I thought, and got tired of doing these steps manually and wrote a script that does the heavy lifting...

If you're on a Mac, you could try MakeMyPi which downloads, if necessary, a Wheezy image and writes it for you, then configures the Pi according to your liking (and any custom provisioning scripts), while filling the SD card with the root file system (so you're not limited to the default ≈2GB space). It even sets up wifi if you want.

The only things you have to do are set the configuration settings before you run it, insert the SD card, follow the instructions, and just a few minutes later you should have a working Raspberry Pi.

From the asciicast of MakeMyPi in action:

MakeMyPi screenshot

(I'm still learning, though, and I know this script can be improved. Feel free to contribute...)

share|improve this answer

There is a tool called Etcher for Windows, Linux, and Mac. It has a simple GUI.

A screenshot from the website:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.