Create a Partition of the SD™ Card to Store the Snapshot Image

Last modified by Microchip on 2026/08/17 13:39

Disk partitioning is the process of dividing a hard drive into multiple sections called partitions. These sections are called primary partitions, and they are formatted with a file system before they can be used to store data. With the FDISK command, you can configure the disk drives on the SD™ card. You can also use GParted, which has a graphical user interface to easily edit disk partitions. See the "GParted Manual" page for details.

FDISK on Linux®

Before creating partitions on an SD card, we recommend listing available space and partitions on the hard disk so you can easily identify the storage device and create a partition on it. You can use the fdisk command with the -1 option to list all available partitions on the disk.

Warning

Caution: Be sure to select the correct disk, especially the one containing the operating system or important data, otherwise the data on that partition will be lost.

fdisk -l

Alternatively, you can use the lsblk command to list information about all the available or specified block devices.

lsblk

Next, you will need to select the storage device on which you want to create partitions. In this case, we will use the /dev/sdb as a storage disk for example:

fdisk /dev/sdb

First, type "m" and press the Enter key to see all available commands and help information as shown:

Fdisk Menu

Back to Top

Create a New Partition

To create a new partition, follow these steps:

Type "n" and press the Enter key to create a new partition.


Select the partition number 3.


Choose the first sector and last sector of the hard disk, press Enter with default sector.


Define the size of the partition. Define the size in KB, MB, GB, TB, and PB. Type "+500M" to set the size of the partition to 500 MB, or type "+1G" to set the size of the partition to 1 GB.


Type "w" and press the Enter key to write changes to the hard disk. You should see the following screen.

Write Table to Disk

You can also type "q" and press the Enter key to exit the fdisk menu. 


Next, you will need to verify whether the partition has been created. You can verify it with the following command:

fdisk -p /dev/sdb

You will see your newly created partition on the following screen:

Print Partition Table

Back to Top

Diskpart on Windows®

Diskpart is a command-line disk partitioning utility included with Windows® operating systems. It allows users to manage disks, partitions and volumes, including creating, deleting, formatting, resizing partitions, as well as assigning drive letters.

Back to Top