How to write Raspbian Jessie image file to SD cards on Apple macOS / OS X

I got a Raspberry PI 3 from my friend. I am a long term macOS user. How do I write Raspbian image file to SD card using macOS?

Raspberry PI 3 is a small and affordable SBC (Single-board computer) that you can use to learn programming or Linux operating system for fun and profit. This tutorial shows how to download and install Raspbian on SD cards when using Apple macOS.

Steps to write Raspbian Jessie image file to SD cards:

  1. Find your SD card name such as /dev/disk2
  2. Unmount /dev/disk2
  3. Write raspbian-jessie.img file using a dd command
  4. sudo dd bs=1M if=fileName.img of=/dev/rdiskN
  5. Finally the eject the SD card and insert into your Raspberry PI 3 computer

Step 1 – Download Raspbian

Visit this page to grab the latest version of OS. I downloaded a file named One can double click to extract the zip file or use the unzip command:
$ unzip
This resulted into a file named 2017-06-21-raspbian-jessie.img. You need to use 2017-06-21-raspbian-jessie.img for writing on SD card.

Step 2 – Find your SD card name on macOS

First, insert the SD card in your Mac. Open the terminal app and type the following diskutil command:
diskutil list
Sample outputs:

Fig.01: Identify the SD card on macOS


  • I have 16 GB SD card on my system.
  • I have identified the disk /dev/disk2 as my SD card
  • Do not use the partition such as /dev/disk2s1, /dev/disk2s2 and so on.
  • Depend upon your Mac config your SD card name may be /dev/disk3 or /dev/disk4 and so on. Use the SD card size to identify correct device name.

Step 3 – Unmount your SD card

To unmount a single volume named /dev/disk2, run:
diskutil unmountDisk /dev/disk2
Sample outputs:

Unmount of all volumes on disk2 was successful

Step 4 – Write the image to your SD card

Warning: The dd command overwrite your SD card. If you give the wrong disk name, the following command will wipe out your data and macOS hard disk. You have been warned. Please keep backups and be careful while typing commands.

You need to use the dd command as follows to write downloaded 2017-06-21-raspbian-jessie.img file to /dev/rdisk2 (remember to replace /dev/disk2 with /dev/rdisk2):
$ sudo dd bs=1m if=2017-06-21-raspbian-jessie.img of=/dev/rdisk2
Sample outputs:

4444+1 records in
4444+0 records out
4659871744 bytes transferred in 385.614770 secs (12084267 bytes/sec)

Step 5 – Eject a disk

To safely remove the SD card and make it ready for use, type the following command:
$ diskutil eject /dev/rdisk2
Sample outputs:

Disk /dev/rdisk2 ejected

Now, remove the SD card and insert into your Raspberry PI 3 computer. Power it on and enjoy your new operating system. Here is my desktop:

Fig.02: Raspberry PI powered by Raspbian Jessie (click to enlarge)

And there you have it, Raspbian Jessie installed and running. Happy programming.

(adsbygoogle = window.adsbygoogle || []).push({});

Posted by: SXI ADMIN

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.


Start your Bitcoin Exchange with our Software

Start your Bitcoin Exchange with our Software Setup your white label bitcoin exchange right away. Or create your own cryptocurrency using...

How to KVM, QEMU start or stop virtual machine from command line (CLI)

KVM or Kernel Based Virtual Machine is a popular virtualization technology. It allows you to run virtual guest machines over a host machine. To start...

How to Docker backup Saving and restoring your volumes

Running a Docker volume backup First, we spin up a temporary container, and we mount the backup folder and the target Docker volume to this container....