Flashing SD Cards

Before you can use your Raspberry Pi you will need to install an Operating System onto an SD Card. When this is done, your SD card is inserted into your Raspberry Pi and is then the rough equivalent of a hard drive in any laptop or desktop computer.

NOTE: This is going to be a super quick post as it really is a super quick process, but for the uninitiated let’s just get some terms out of the way first:

  • Raspberry Pi = This is our tiny little computer
  • SD Card = It’s like a normal hard drive with no moving parts
  • Operating System = Think of this as the engine that runs all the programs on your computer, others would be Windows, Linux and macOS
  • Flashing = There are many names for this process, but it simply means to put the Operating System onto the SD card
  • Terminal = This is a text interface that operate your computer, rather than using a mouse.

Ingredients

As always we begin with the ingredients we will need:

  • Raspberry Pi
  • 1 SD Card (I recommend more than 8 GB and Class 10)
  • The Raspbian Operating System
  • A computer with an SD card slot, or an SD card adapter.
  • A copy of the application Etcher

The Method

There’s a million different ways to accomplish this task, each way encompassing its own risks and levels of difficulty. Sure, I know how to do this using the Terminal and the dd command but why would I when I have such a simple application as Etcher to do most of the hard work for me? I’m sure other people will disagree and there is certainly some merit in learning how these things work behind the scenes, but for now we just want a working Raspberry Pi and this is the quickest way to do it I know of. Eyes on the prize people!

That said, if do want to use the Terminal for all of this process, there are some excellent instructions from the Raspberry Pi Foundation at the bottom of this page.

For the rest of us, onwards!

Step One

  • Download the Raspbian Lite Operating System. Make sure to choose the Lite version.
  • Unzip your downloaded file and save the .img file to your Downloads folder.

Step Two

Download Etcher. I’m using a Mac, but there are Windows and Linux versions as well.

Step Three

Open Etcher and you will see the following screen:

Etcher

Choose the Select Image button as shown; a file chooser will appear. Pick the Raspbian Lite .img file in your Downloads folder.

Select Image

After pressing Open you will be returned to the main Etcher screen, where you will now notice that the middle option is now open to you. Press the Change button and make sure that your SD card is selected, this is a very important step because if you select the wrong disk you could turn your very expensive computer into a very cheap Raspberry Pi. This is fairly unlikely because Etcher is clever enough to know which disk is which, but you should ALWAYS check. Click on the button marked Change, which is the middle option:

The Right SD Card

After clicking the Change button you will be presented with the following screen so you can make sure you have correct SD card selected, if it is click Continue:

Choosing the right SD card

After pressing Continue you will now notice that the right hand most button is available to you, it’s called Flash!. So as that’s what we’re here to do, I want you to push it with some vigour!

Flashing

Now we wait my young Padawan… You will notice from the following image that the Flash! button turns orange and gives you a progress report:

Flashing in progress

During what I like to call “The Orange Phase” of flashing, it’s time for the traditional “drinking too many caffeinated beverages while we wait for a computer to finish doing what it’s doing” process. So go away and do that.

When everything is finished it will look like this:

Done

Quit the Etcher application and remove the SD card from your computer, but don’t do anything with the SD card just yet as there is one more step left.

Step Four

It used to be at this point you could stick your SD card into your shiny new Raspberry Pi, fire it up and be able to login via SSH straight away. However, because security there is now an added step. We need to put a small file called ssh onto the SD card we just flashed, this file doesn’t need to contain anything it just needs to be present. How this is accomplished will vary from platform to platform, but to do it on macOS you will need to use the Terminal.

The SD card will probably be named boot, so you need to reinsert your SD card and search for where it’s mounted on your computer. To get to the right location on macOS you will need to open the Terminal and type in the following command:

cd /Volumes/boot

Creating the ssh file is easy and only requires the following command:

Creating the ssh File

touch ssh

Let’s just confirm that the file was created properly by running the ls command which will list the contents of our current directory. You’ll see loads of different filenames but the only one you’re really concerned with is the one called ssh and whether it is present or not.

Confirming your ssh File Exists

ls

Step Five

With the presence of our ssh file confirmed we can now safely eject the SD card and put it into our new Raspberry Pi. Now, when we power up the Pi we should have immediate SSH access to it. Without that ssh file being in place you would be forced into using a keyboard and monitor to setup your Raspberry Pi. This is obviously difficult quadriplegics which makes this one small but slightly onerous step definitely worth it.

Definitely don’t forget to change your password first time you log into your new Raspberry Pi!

As always, email me if you get stuck!