Formatting a Micro SD Card with FAT32 Using gparted on Ubuntu

Preparing a clean SD card for NOOBS using gparted on Ubuntu Linux

Vivek Bhadra  |  Raspberry Pi Ubuntu gparted SD Card

For formatting the micro SD card I usually use the gparted utility in Ubuntu. Format the micro SD with FAT32 filesystem format. You need to have a SD card reader for attaching the SD card to the PC. I use the below SD card and the reader for my purposes:

Once you have attached your SD card with the linux PC you are ready to format it. I am using a Ubuntu PC for my purposes. Go to the console and run the below command:

~$ sudo gparted
gparted opening screen
gparted opening screen

What we are up to is delete everything in the SD card and get it ready for the NOOBS.

By default the gparted selects your hard drive (/dev/sda is actually your hard drive, did you know!).

Warning: Be very cautious, not to play around with your hard drive partitions, you might soon get into a funny situation.

Go to the top right corner of the gparted screen and change the drive from /dev/sda to /dev/sdb (if there are no other media attached to the PC). Look at the various field carefully and try to understand what they are. I cannot go into the details of all the fields here. I can see the below in my SD card (/dev/sdb) at the moment:

gparted showing SD card partitions on /dev/sdb
gparted showing the existing partitions on the SD card (/dev/sdb)

You can also see the same partitions with lsblk command on the console, I can see the below:

sda      8:0  0 465.8G 0 disk
├─sda1   8:1  0   512M 0 part /boot/efi
└─sda2   8:2  0 465.3G 0 part /
sdb      8:16 1  29.7G 0 disk
├─sdb1   8:17 1   2.4G 0 part
├─sdb2   8:18 1     1K 0 part
├─sdb5   8:21 1    32M 0 part
├─sdb6   8:22 1   256M 0 part
└─sdb7   8:23 1  27.1G 0 part

As you can see above the SD card has in total 5 partitions /dev/sdb1, /dev/sdb2, /dev/sdb5, /dev/sdb6, /dev/sdb7. I want to get rid of all of these. So what I do in gparted screen is to: Select/highlight each partition. Right click, and then Unmount. Once the selected/highlighted partition has been Unmounted, right click and Delete it. Unmount and Delete each of these partitions in the SD card. Now Click on the green Tick at the top of the gparted screen and Apply. At this point you would have unallocated partition like this:

gparted showing unallocated space after deleting all partitions
All partitions deleted, SD card now shows as unallocated
gparted Apply button
Click on the Tick (Apply) button as above

Right click on the Unallocated partition and click on New. Leave everything as default except Filesystems as FAT32, the default is ext4.

gparted new partition dialog
New partition dialog – change filesystem from ext4 to FAT32

After changing the file systems type it should look like the below:

gparted new partition set to FAT32
Filesystem set to FAT32

Click Add. Then again click on the green Tick button at the top, then Apply. Once done, you should see something like the below:

gparted after applying FAT32 partition
After clicking Add, the pending operation appears in gparted
gparted Apply confirmation
Click on the Apply button
gparted Apply confirmation dialog
Click on Apply button
gparted applying operations
gparted applying the formatting operations
gparted formatting in progress
Formatting in progress
gparted formatting complete
It looks like this in my PC

Once it is finished, close gparted and go back to your favorite file browser and locate the SD card, in my case it shows something like the below, an empty drive:

File browser showing the freshly formatted empty SD card
The freshly formatted SD card appearing as an empty drive in the file browser

Now your SD card is formatted with FAT32 filesystem format.

Leave a Reply