How To Format/Fix Your SD Card

Need to format your SD card? Does your 8gb or 32gb or 64gb SD card show that it only has a size of 30mb? Well you probably need to re-format it. This available size issue happens a lot with SD cards used in Raspberry Pi’s. The linux kernel and Rasbian operating system make partitions, and most SD cards and computers don’t like this. So let’s learn how to format an SD card.

It’s a quick and simple fix! The most clean and proper way to do this is through command prompt using the diskpart utility. Here’s how! (See the image below for reference)

The Steps

  1. Insert your SD card into your SD card slot or with a usb card reader.
  2. Bring up the command prompt. Go to your Windows start menu and type in “cmd” in the search box and hit enter.
  3. Once you’re in the command prompt window you need to simply type “diskpart” without the quotation marks and hit enter.
  4. A new windows will pop up asking you if you’d like to allow the application to make changes on your device. Click yes. A new command prompt looking window will open up.
  5. Within’ this window you’ll want to type “list disk” without the quotations. The window will list all the available disk drives currently accessible by your computer.  It should be fairly clear from the size of the disk which one is the SD card you need to format. Just know that every card or hard drive inserted into your computer including your computers hard drive will be listed. So make sure to select the correct one. Also be aware that the size listed will be slightly less than the advertised size of your card. If you want to know why that is check out this article. If you have a 32gb SD inserted it will most likely show as 29gb.
  6. Once you know which disk is the card you’d like to format you’ll want to type “select disk 1” (or the number pertaining to your disk) and hit enter. This will select the disk you want to format. DiskPart will prompt you which disk is selected.
  7. Next you’ll want to type “clean”. Make sure you’re ready to wipe your disk before hitting enter as this will completely clear all data and partitions from the drive. After hitting enter DiskPart will tell you it has succeeded in wiping the disk.
  8. Next you’ll want to type “create partition primary” and hit enter. This creates a new primary partition that will utilize all available space.
  9. Next you need to select your newly created partition by typing “select partition 1” and hitting enter.
  10. After that you’ll need to activate the partition by typing “active”. This makes it active for formatting and manipulation.
  11. To format your drive you’ll use the simple command “format fs=ntfs quick”and hit enter. Any drive under 64gb shouldn’t take much more than 15 seconds to format.
  12. Once formatted you’ll need to assign a drive letter to your newly partition SD card. To do this type “assign” and hit enter. Your computer will most likely prompt you that a new disk (i.e. Drive E:) has been inserted.
  13. You can now close the DiskPart window and you’re all set!

Time to get cracking with your newley formatted SD card. To start things off you’ll probably want to get NOOBS and install Rasbian onto your new Raspberry Pi! Click here to learn how.