SD Card Partitions when installing Raspbian for Raspberry Pi

From the very start that I used a Raspberry Pi I have always been curious about how it partitions the microSD Card every step of the Raspbian installation to running the Raspberry Pi.

You will see below on what happens to your SD Card Paritions every step of the installation to running the Raspbian on your Raspberry Pi.


Testing Parameters

SD Card Sizes

I shall be using 2 SD Card memory sizes, 8GB and 16GB. The reason for me using these memory sizes is for us to see if there are any differences on the SD Card Partitions depending on the SD Card size.

Checking of the SD Card Partitions

I shall use Partition Wizard on Windows 10 to check the SD Card partitions as it has a graphical representation of the different partitions and it can detect Linux and Mac file systems.


1. After Formatting the SD Card

I formatted the SD Card to FAT32 using Windows’ formatting tool.

After formatting the SD Card to FAT32 - 8GB
8GB After formatting to FAT32
After formatting the SD Card to FAT32 - 16GB
16GB After formatting to FAT32

Results

8GB 16GB
Partitions 7.36GB – FAT32 14.43 GB – FAT32

2. After Installation of Raspbian Image

Downloaded the latest Raspbian Image from the Raspberry Pi website.  Wrote the Raspbian Image (.img) inside the downloaded zip file to the SD Card using Etcher.

Writing the Raspbian Image using Etcher

Note: As of writing the latest version of Raspbian is with the following properties.

  • Version: September 2017
  • Release Date: September 9, 2017
  • Kernel Version: 4.9
  • Zip File Size: 1.63 GB (1,757,290,390 bytes)
  • Img File Size: 4.57 GB (4,916,019,200 bytes)

Results

microSD Card Parition after writing the Raspbian Image 8GB SD
8GB – After writing the Raspbian Image
microSD Card Parition after writing the Raspbian Image 16GB SD
16GB – After writing the Raspbian Image

For comparison here is a side-by-side table partition.

8 GB 16 GB
E: boot (FAT32) 41.81 MB 41.81 MB
F: (ext4) 4.53 GB 4.53 GB
Unallocated 2.78 GB 9.86 GB

The first 2 partitions (boot FAT32, ext4) have the same size but the third (Unallocated) has a different size for the 8GB and 16GB SD Cards. The reason for this is that the Raspbian Image only includes the first 2 partitions and since the SD Card sizes are bigger than the Raspbian Image the excess would be unallocated.


3. After Running the Raspbian Image on a Raspberry Pi

I inserted the SD Card to a Raspberry Pi and have it ran once. I did not do anything. Turned off the Raspberry Pi again and checked for the partitions.

After turning on the Raspberry Pi with the SD Card 8GB
8GB – After using the SD Card on the Raspberry Pi
After turning on the Raspberry Pi with the SD Card 16GB
16GB – After using the SD Card on the Raspberry Pi

Comparison Table

8 GB 16 GB
E: boot (FAT32) 41.81 MB 41.81 MB
F: (ext4) 7.31 GB 14.39 GB

What happened to the unallocated partition?

On the initial startup of the Raspberry Pi using our newly written Raspbian on the SD Cards one of the prompts that was seen was expanding the file system. What this means is that the Raspberry Pi was converting the Unallocated parts of the SD Card to ext4 and adding it to the F: partition.

With this the Raspberry Pi would be able to use the full memory of the SD Card rather than being dependent on the 4.53 GB memory of the Raspbian image.


With that I now know what happens to the SD Card paritions during Raspbian Installation and the initial run of the SD Card with the Raspberry Pi.

One thought on “SD Card Partitions when installing Raspbian for Raspberry Pi”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.