Create an Ubuntu image for a Raspberry Pi on MacOS

Overview

Duration: 1:00

In this tutorial, we will walk you through creating a bootable Ubuntu microSD card for your Raspberry Pi .

What you’ll learn

How to create a bootable microSD card to run Ubuntu on your Raspberry Pi

What you’ll need

:warning: Warning
Following these steps will erase any existing content on the removable drive!

Please note
The following instructions are for MacOS users. We also have tutorials for Ubuntu and Windows users.

On your MacOS machine

Duration: 5:00

  1. Download the Ubuntu image for your device in your **Downloads** folder

  2. Insert your microSD card

  3. Open a terminal window (Go to Application » Utilities, you will find the Terminal app there), then run the following command:

    diskutil list

  4. In the results, identify your removable drive device address, it will probably look like an entry like the ones below:

/dev/disk0
#:     TYPE NAME                       SIZE         IDENTIFIER
0:      GUID_partition_scheme         *500.3 GB     disk0

/dev/disk2
#:     TYPE NAME                       SIZE         IDENTIFIER
0:     Apple_HFS Macintosh HD         *428.8 GB     disk1
Logical Volume on disk0s2
E2E7C215-99E4-486D-B3CC-DAB8DF9E9C67
Unlocked Encrypted

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

Note
Your removable drive must be DOS_FAT_32 formatted. In this example, /dev/disk3 is the drive address of an 8GB microSD card.

  1. Unmount your microSD card with the following command:

    diskutil unmountDisk < drive address >

  2. When successful, you should see a message similar to this one:
    Unmount of all volumes on < drive address > was successful

  3. You can now copy the image to the microSD card, using the following command:
    sudo sh -c 'gunzip -c ~/Downloads/< image file > | sudo dd of=< drive address > bs=32m'

    When finalised you will see the following message:

3719+1 records in
3719+1 records out
3899999744 bytes transferred in 642.512167 secs (6069924 bytes/sec)
  1. You can now eject your microSD card

That’s all folks!

Duration: 1:00

You did it!

Now you can put the microSD card in your Raspberry Pi and boot it up.

1 Like

Should be

1 Like

Thanks for the catch @maxaltena, let us know if you spot anything else :slight_smile:

Should be: The following tutorial is for macOS users.

MacOS should be stylised as macOS

1 Like

Thanks, fixed. I was posting all three at once and messed up.

1 Like

The guide was mostly good. A couple of things I would comment on though:

I would expand a bit on the importance of the FAT32 partitioning. My SD card had a Linux partition already on it, and a FAT32 partition that was only 280MB… and that’s all that MacOS saw until I selected the Show All Devices option in Disk Utility: image

The other comment is in regard to the dd command. It takes a long time to run. I suggest opening Activity Monitor to check the progress of it. Sort by Process Name and look for dd