Skip to content

Formatting a microSD Card

Info

Choose the tab corresponding to the operating system you are using to format your SD card. Windows or Linux systems are recommended, but MacOS should work as well if it's your only choice.

ChromeOS/Android/iOS are NOT reliable devices to format your SD card with!

Operating System:

Warning

Make sure to use the correct tab for your SD card size. This is important, or you may end up formatting to the wrong filesystem by choosing the wrong tab!

Formatting an SD card will WIPE ALL FILES on it. If you have any data on the SD card that you would like to keep, back it up your PC before formatting.

  1. Download the latest version of SD Memory Card Formatter.

    • Accept the End User License Agreement to start the download
  2. Insert your SD card into your computer.

  3. Run SD Card Formatter Setup (the .exe file) in the downloaded .zip file with Administrator privileges, then install the program.

  4. Run SD Card Formatter from the Start Menu.

  5. Select your SD card’s drive letter for Select Card.

    • Make sure you choose the correct drive letter, otherwise you might accidentally erase the wrong drive!
  6. Ensure that Quick Format is selected.

  7. Click Format.

  8. Click OK.

  9. Wait for the format to finish.

  10. Click OK.

  11. Close the SD Card Formatter program.

  1. Download the latest version of SD Memory Card Formatter.

    • Accept the End User License Agreement to start the download
  2. Insert your SD card into your computer.

  3. Run SD Card Formatter Setup (the .exe file) in the downloaded .zip file with Administrator privileges, then install the program.

  4. Run SD Card Formatter from the Start Menu.

  5. Select your SD card’s drive letter for Select card.

    • Make sure you choose the correct drive letter, otherwise you might accidentally erase the wrong drive!
  6. Ensure that Quick Format is selected.

  7. Click Format.

  8. Click OK.

  9. Wait for the format to finish.

  10. Click OK.

  11. Close the SD Card Formatter program.

    Note

    You're not done yet! Your SD card will be formatted to exFAT at this point. The following steps will format it to FAT32.

  12. Download GUIFormat.

  13. Run guiformat.exe.

  14. Select your SD card’s drive letter for Drive.

    • Make sure you choose the correct drive letter, otherwise you might accidentally erase the wrong drive!
  15. Set Allocation unit size to 32768.

  16. Ensure that Quick Format is selected.

  17. Click Start.

  18. Click OK.

    Errors in GUIFormat

    You may encounter an error while using GUIFormat. See below for possible codes and solutions:

    Failed to open device: GetLastError()=32

    • Close everything that may be using the SD card, such as any File Explorer windows.

    GetLastError()=1117

    • Your SD card write-protection switch may be enabled. The lock switch must be flipped upwards to allow writing to the SD card. (including formatting)
  19. Wait for the format to finish.

  20. Click Close.

Warning

The commands in this guide are case-sensitive. Enter them exactly as written, or there may be unintended consequences.

Formatting an SD card will WIPE ALL FILES on it. If you have any data on the SD card that you would like to keep, back it up your PC before formatting.

  1. Make sure your SD card is not inserted.

  2. Open a terminal window and run the command watch lsblk

  3. Insert the SD card and watch for a new device appearing in lsblk.

  4. Observe the output for the new device. It should match something like this:

    NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    mmcblk0     179:0    0 29.7G  0 disk 
    └─mmcblk0p1 179:1    0 29.5G  0 part /run/media/user/FFFF-FFFF
    
  5. Take note of the name of the device that now appears. In the example above, it was mmcblk0, but it could show up as sda or sdb, if you use a USB adapter.

    • If RO is set to 1, make sure the lock switch is not slid down.
    • Device name is not the partition name. In the example above, the device name is mmcblk0, and the partition name is mmcblk0p1.
  6. Hit CTRL + C to exit the menu.

  7. Run sudo umount /dev/<device name>* (do not replace the *)

  8. sdFormatLinux is not available in repositories, so it has to be installed using one of the following methods:

    1. Download the latest release from https://github.com/profi200/sdFormatLinux/releases

    2. Install the 7zip utility if you don't have it already.

    3. Extract the downloaded archive:

      7z x sdFormatLinux_vX.X.X.7z
      
      Replace X.X.X with the version number you downloaded.

    4. Navigate into the extracted directory with cd.

    1. Clone the repository and compile:
      git clone https://github.com/profi200/sdFormatLinux.git
      cd sdFormatLinux
      make
      
  9. For SD cards 64GB or larger (SDXC), run the following command to format to FAT32:

    sudo ./sdFormatLinux -f -e trim /dev/<device name>
    

    • The -f option forces FAT32 format for SDXC cards
    • The -e trim option will erase the card before formatting (improves performance)
    • You can optionally add the -v option to get verbose status updates during formatting
  10. For SD cards 32GB or smaller, the -f flag is not needed:

    sudo ./sdFormatLinux -e trim /dev/<device name>
    

  11. If you want to add a volume label to your SD card, use the -l option:

    sudo ./sdFormatLinux -l 'MY LABEL' -e trim -f /dev/<device name>
    

    • Labels are limited to 11 uppercase characters
  12. Wait for the format to complete. If you added the -v (verbose) option, you'll see details about the formatting process.

  13. Run sudo eject /dev/<device name>, then remove the SD card. You're done!

Why use sdFormatLinux?

sdFormatLinux formats SD cards according to SD Association specifications, optimizing them for flash-based media. This provides better performance and longevity compared to generic formatting tools. When using the -f option for SDXC cards, it creates a FAT32 filesystem with 64 KiB clusters, which is optimal for performance while maintaining compatibility with devices that don't support exFAT.

  1. Make sure your SD card is not inserted.

  2. Open a terminal window and run the command watch lsblk

  3. Insert the SD card and watch for a new device appearing in lsblk.

  4. Observe the output for the new device. It should match something like this:

    NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    mmcblk0     179:0    0 29.7G  0 disk 
    └─mmcblk0p1 179:1    0 29.5G  0 part /run/media/user/FFFF-FFFF
    
  5. Take note of the name of the device that now appears. In the example above, it was mmcblk0, but it could show up as sda or sdb, if you use a USB adapter.

    • If RO is set to 1, make sure the lock switch is not slid down.
    • Device name is not the partition name. In the example above, the device name is mmcblk0, and the partition name is mmcblk0p1.
  6. Hit CTRL + C to exit the menu.

  7. Run sudo umount /dev/<device name>* (do not replace the *)

  8. Install the fdisk and dosfstools packages using your package manager of choice, if they are not installed already.

  9. Run sudo fdisk /dev/<device name>

  10. Enter o. This will create a new MBR partition scheme.

  11. Enter n, then press enter until you're returned to the prompt.

    • The default values will work fine for all consoles.
  12. Enter t, then enter 0c

  13. Enter a, and then p. Observe the output, and make sure the device is now formatted correctly:

    Disk /dev/mmcblk0: 29.72 GiB, 31914983424 bytes, 62333952 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x########
    
    Device                Boot  Start      End  Sectors  Size Id Type
    /dev/<partition name>        8192 62333951 62325760 29.7G  c W95 FAT32 (LBA)
    
  14. If there are no issues, enter w. This will save changes and exit the fdisk program.

  15. Run sudo mkfs.vfat /dev/<partition name> -s 64 to format the new partition to FAT32.

  16. Run sudo eject /dev/<device name>, then remove the SD. You're done!

  1. Make sure your SD card is not inserted.

  2. Open a terminal window and run the command watch lsblk

  3. Insert the SD card and watch for a new device appearing in lsblk.

  4. Observe the output for the new device. It should match something like this:

    NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    mmcblk0     179:0    0 29.7G  0 disk 
    └─mmcblk0p1 179:1    0 29.5G  0 part /run/media/user/FFFF-FFFF
    
  5. Take note of the name of the device that now appears. In the example above, it was mmcblk0, but it could show up as sda or sdb, if you use a USB adapter.

    • If RO is set to 1, make sure the lock switch is not slid down.
    • Device name is not the partition name. In the example above, the device name is mmcblk0, and the partition name is mmcblk0p1.
  6. Hit CTRL + C to exit the menu.

  7. Install the parted and dosfstools packages using your package manager of choice, if they are not already installed.

  8. In your terminal, run sudo parted /dev/<device name> mklabel msdos

  9. Run sudo parted -a opt /dev/<device name> mkpart primary fat32 0% 100%

  10. Run sudo mkfs.vfat /dev/<partition name> -s 64 to format the new partition to FAT32.

  11. Run sudo eject /dev/<device name>, then remove the SD. You're done!

  1. Make sure your SD card is not inserted.

  2. Open KDE Partition Manager, inputting your password as needed.

  3. Insert your SD card and click Refresh Devices. The new device that shows up in the left pane is your SD card.

  4. Click your SD card, then click the New Partition Table button at the top of the window.

  5. When asked, choose MS-Dos. Do NOT use GPT. (1)

  6. Right click the unallocated space in the right pane, and select New.

  7. When selecting your filesystem, choose FAT32 from the drop-down menu. (2)

  8. Click OK, then click Apply, and then Apply Pending Operations.

  9. Eject your SD card. You're done!

  1. Partition Table Settings

  2. Filesystem Settings

Warning

Make sure to use the correct tab for your SD card size. This is important, or you may end up formatting to the wrong filesystem by choosing the wrong tab!

Formatting an SD card will WIPE ALL FILES on it. If you have any data on the SD card that you would like to keep, back it up your PC before formatting.

  1. Download the latest version of SD Memory Card Formatter.

    • Accept the End User License Agreement to start the download
  2. Insert your SD card into your computer.

  3. Run Install SD Card Formatter (the .mpkg file) in the downloaded .zip file.

  4. Run SD Card Formatter

  5. Select your SD card for Select Card.

    • Make sure you choose the correct device, otherwise you might accidentally erase the wrong drive!
  6. Ensure that Quick Format is selected.

  7. Click Format.

  8. Wait for the format to finish.

  9. Click OK, then close the SD Card Formatter program.

  10. Eject your SD card, and then you're done!

  1. Download the latest version of SD Memory Card Formatter.

    • Accept the End User License Agreement to start the download
  2. Insert your SD card into your computer.

  3. Run Install SD Card Formatter (the .mpkg file) in the downloaded .zip file.

  4. Run SD Card Formatter

  5. Select your SD card for Select Card.

    • Make sure you choose the correct device, otherwise you might accidentally erase the wrong drive!
  6. Ensure that Quick Format is selected.

  7. Click Format.

  8. Wait for the format to finish.

  9. Click OK, then close the SD Card Formatter program.

    Note

    You're not done yet! Your SD card will be formatted to exFAT at this point. The following steps will format it to FAT32.

  10. Choose a tab below based on the version of MacOS your computer is running to continue:

  1. Launch the Disk Utility application.

  2. Select Show All Devices in the top-left View panel.

  3. Select your SD card from the sidebar.

    • Make sure you choose the correct device, otherwise you might accidentally erase the wrong drive!
  4. Click Erase at the top.

  5. Ensure that Format is set to MS-DOS (FAT32).

    • On El Capitan (10.11) through Catalina (10.15) choose MS-DOS (FAT).
  6. Ensure that Scheme is set to Master Boot Record.

    • If Scheme does not appear, click Cancel and make sure to choose the device instead of a volume.
  7. Click Erase, then click Close.

  8. Eject your SD card, and then you're done!

  1. Launch the Disk Utility application.

  2. Select your SD card from the sidebar.

    • Make sure you choose the correct device, otherwise you might accidentally erase the wrong drive!
  3. Click Partition at the top.

    • If Partition does not appear, make sure to choose the device instead of a volume.
  4. Ensure that Partition Layout is set to 1 Partition.

  5. Ensure that Format is set to MS-DOS (FAT).

  6. From the Options button (below the partition table), select Master Boot Record.

  7. Click OK, then Apply, and then Partition.

  8. Eject your SD card, and then you're done!