How To Format An SD Card In Raspberry Pi

An SD card is a handy device that gives you extra storage and lets you hold data on a removable memory card to transfer between devices. 

Raspberry Pi boards will come with an SD card, which lets you boot up different operating systems and files.

You can also use an external SD card. This can be installed to improve your Raspberry Pi’s memory as well as to run specific files (such as games, photos, and programs) that won’t run on the board’s default SD card. 

To do this, you’ll need a certain type and format of SD card, as many types of SD cards won’t be compatible with a Raspberry Pi and can harm its performance.

If you’re using an external SD card with your Raspberry Pi, you’ll probably have to format it properly before you can start using it with the computer. 

But just how do you format an SD card for your Raspberry Pi?

Don’t worry – we’ve got you covered. 

This handy guide will walk you through all the necessary steps to format an SD card in preparation for using it with a Raspberry Pi.

How to Format an SD Card in Raspberry Pi

What SD Card Formats And Sizes Do Raspberry Pi Use?

SD cards come in a range of different sizes, all with varying capacities. These can be anywhere from 2Gb for a MicroSD card, all the way up to 32Gb and beyond. 

Some high-capacity SD cards can even hold multiple terabytes of data, although these are far less common and won’t come into play with a Raspberry Pi. 

Typically, a standard SD card will hold either 16Gb or 32Gb of data.

Now that we’ve covered how much a standard SD card holds, let’s take a look at which SD cards are compatible with Raspberry Pi and why you might need to format them. 

To do this, we need to know the formats that work with Raspberry Pi.

A Raspberry Pi is designed to work with two main formats of SD cards. These formats are FAT16 and FAT32. Here’s a quick rundown of each type.

FAT16 is an older file system that sorts data into groups of 16 bits. 

It was initially developed to be used with floppy disks – as a result, it has a much lower storage capacity than other, newer file systems. 

FAT16 SD cards have a lower memory, ranging from 128Mb to a maximum of 2Gb. This limits the size and amount of files that can be stored on the SD card, as well as what sorts of files can be stored.

FAT32, meanwhile, is a newer and upgraded file system with much more storage capacity. A FAT32 SD card can hold anywhere from 4Gb up to 32Gb. 

This makes them better at storing larger and more complex files, and FAT32 is a much more common form of memory card than lower-capacity SD cards in the modern day.

Another, more recent format of SD card is known as exFAT, and is used within SDXC cards that have an increased capacity. This can be anywhere from 64Gb to 1 or 2Tb, which is much more than a Raspberry Pi is capable of handling.

A Raspberry Pi’s bootloader (the system that boots up a computer and gets it running) is designed to work with FAT16 and FAT32. Any other formats and sizes and your Raspberry Pi will stop running properly if it can even boot up at all. 

This means that you’ll need to use the correct type of SD card with your Raspberry Pi if you want it to work, as the bootloader will be unable to start up without the right SD card format.

If you have an SD card that’s the wrong format for your Raspberry Pie, you’ll need to format it to your device as soon as possible. 

This will let you access your Raspberry Pi’s data and files, move them around, and create new ones without the fear of running out of storage space. 

It will also ensure that you can boot your Raspberry Pi up and use it for its intended purposes.

How To Format Your SD Card For Your Raspberry Pi

Now you know why you might need to format your Raspberry Pie, how do you go about doing so? 

It’s a bit of a tricky process, so you’ll need some help learning your way around a Raspberry Pi and SD card formatting. Luckily, there are plenty of tutorials online that will show you how to do just that.

The first thing you should do when trying to format your SD card is to make sure that you’re using the right size of SD card. 

While there are many types of SD cards out there, you should be using a FAT16 or FAT32 card as these are the ones a Raspberry Pi’s bootloader is designed to read information off of. 

Once you’ve made sure you’re using an appropriate format of SD card, it’s time to get into formatting it.

To begin, you’ll need to insert your SD card into your Raspberry Pi’s SD card slot. You should be able to insert it in the normal SD card slot in the Raspberry Pi. 

As long as the card is the right size, you’ll be able to fit it without any trouble (if your SD card is the wrong size, you’ll struggle to fit it in and risk damaging the Raspberry Pi).

Formatting An SD Card Through Raspberry Pi Imager

You can format an SD card directly through the Raspberry Pi Imager. 

This lets you format it directly on the machine without the need for any other external hardware or software. 

It’s also the easiest and simplest method of formatting an SD card for your Raspberry Pi. 

Bear in mind that these instructions are for a FAT32 SD card, as these are the ideal type of SD card for your machine.

First, you need to install Raspberry Pi Imager. 

You can either do this by downloading it from the Raspberry Pi website’s installation files or through the Raspberry Pi itself via a command on the terminal. 

Go onto the terminal, and run the following command, directly as written: 

$ sudo apt install rpi-imager. 

Don’t include the period at the end.

Next, boot up the Raspberry Pi Imager. 

It will bring up a home screen, with an option to ‘Choose OS’. Select it, and then select the ‘Erase (Format card as FAT32)’ option from the menu that appears. 

From here you should click on ‘Choose SD Card’, which will bring you to a list of the SD cards available for you to format.

You should only have the one SD card available, which is the one you’ve inserted to format. Select this one, then click on ‘Write’.

This will begin the formatting process. From here, all you need to do is wait for the formatting to complete, and you’re good to go.

Formatting An SD Card Through GParted

For Linux- or Raspian-based OS, an alternative to formatting with Raspberry Pi Imager is using GParted. 

This is a completely separate command-line tool, so you’ll need to boot your Raspberry Pi through a different SD card from the one you intend to format.

Again, you need to start by installing GParted. To do this with a terminal command, you’ll to use a slightly longer command as follows:

$sudo apt-get update

$sudo apt-get upgrade

$sudo apt-get install gparted

You can also download it directly from the GParted website and install it from your SD card.

Now, open GParted with the command (again, don’t include the period): $ sudo gparted. Select the SD card you wish to format from the drop-down menu at the top of the screen.

Select all the partitions listed below, then click ‘delete’ followed by ‘apply’. Then, click ‘new’; you’ll be asked to choose a new file system, so select FAT32. Now, select ‘add’, ‘apply’, and click confirm. 

Alternatively, you can right-click the SD card and hover over ‘Format to’, which will bring up a list of formats. Click on FAT32 and apply in the same way.

This will begin formatting your SD card, ready for you to use in your Raspberry Pi. 

Final Thoughts

These are just two ways you can format your SD card in your Raspberry Pi. 

There are several other methods you can use to prepare your SD card; however, these are two of the easiest and simplest methods to follow along with.

Formatting an SD card will give you a lot of different options. You can either use it for additional storage or as a way to transfer files onto and out of your Raspberry Pi.

While formatting an SD card might seem like a daunting process that you’ll need a Computer Science degree to understand, hopefully, this guide has helped clear things up for you and make the process a bit easier to understand. 

It can be tricky getting this process to work on the first try, especially when some code is involved. 

By being patient and following these instructions carefully you should have no problem getting all your SD cards to the right format for you to use.

Good luck!

Melanie Nilsen
Latest posts by Melanie Nilsen (see all)