If you have installed a version of Linux to your SD card because for use on a single board computer such as a Raspberry PI then there may come a point in time when you want to re-purpose that SD card for other uses.
When you attempt to format the drive you realise that there is only a few megabytes available. The chances are that the SD card has been partitioned so that the SD card could boot correctly into Linux.
If you suspect your SD card has been partitioned you can check by following these steps:
- If you are using Windows 8 and above right click on the start button choose “Disk Management” from the menu
- If you are using Windows XP, Vista or Windows 7 click on the start button and type diskmgmt.msc into the run box.
- Find the disk number for your SD card
You should be able to see a number of partitions assigned to your SD card. Quite often the first partition will show as unallocated, the second will be a small partition (for example 2 megabytes) and the third will be for the rest of the space on the drive.
To format the SD card so that it is one continuous partition follow these steps:
- If you are using Windows 8 and above you can right click the start button and Click “Command Prompt (Admin)”
- If you are using XP, Vista or Windows 7 press the start button and right click on the “Command Prompt” option and choose “Run as administrator”. You may need to navigate through the menus to find the “Command Prompt” icon.
- Type diskpart
- Type list disk
- Find the disk number that matches your SD card (should be the same size)
- Type select disk n (where n is the disk number representing your SD card)
- Type list partition
- Type select partition 1
- Type delete partition
- Repeat steps 8 and 9 until there are no more partitions (note that it will always be partition 1 that you delete because as soon as you delete one the next one along will become partition 1).
- Type create partition primary
- Open Windows Explorer and click on the drive matching your SD card
- A message will appear as follows: “You need to format the disk before you can use it”. Click the “Format Disk” button
- The Format SD Card window will appear. The capacity should now show the size of the whole drive.
- Choose either FAT32 or exFAT depending on the size of the SD card
- Enter a volume label
- Click “Start”
- A warning will appear stating that all data will be deleted. Click “OK”.
Your SD Card will now be formatted.