How to Format SD Card Using CMD | Terms and Tips

Terms and Tips on Formatting SD Card Using CMD

Do you need to format an SD card? There are many ways to do so. In this guide, we show you how to format an SD card using CMD. We also provide you with detailed tips on how to solve any problems you encounter.

Wondershare Recoverit Authors

Oct 16, 2020 • Filed to: SD Card Solutions • Proven solutions

0

Ever wondered how to format an SD card using CMD? There are many ways to format an SD card. You probably already know how to do it on your phone or a PC using Windows Explorer. But sometimes these options may not be available or cannot work.

Formatting a memory card is necessary when it shows signs of corruption. If you notice that it isn't working the way it's supposed to work, then you should consider a CMD memory card format. This will erase everything on the storage and rewrite the file system.

Important Terms Before Formatting SD Card Using CMD

Before we get into the nitty-gritty of formatting an SD card using CMD, there are some concepts you need to understand.

What's an SD Card and How Does It Work?

An SD card is storage media common on devices such as digital cameras, cell phones, laptops, baby monitors, and many more devices. The card is small and portable. This portability makes it ideal to transfer data between devices.

When Do You Need to Format SD Card?

There are two main reasons you may need to format an SD card:

What's CMD and How Does It Work?

CMD is an abbreviation for Command. It is a common reference to the Windows Command Prompt, a powerful interpreter that executes commands once entered by the user. Its executable command is cmd.exe. There are several ways to launch CMD depending on your Windows version. In Windows 10, typing Command Prompt in the Windows search bar at the bottom left of a Windows PC will launch the program.


What SD Card Issues Can CMD Resolve?

The Command Prompt is a powerful utility that gets things done when other methods fail. Below are CD card issues that CMD can quickly resolve.

Issue 1: Corruption

SD card corruption happens because of power, hardware, or software failure. It can also happen because of an infection by a computer virus. There are many symptoms that corruption has occurred but below are the most common:

In such situations, the chkdsk command can repair a damaged SD card using CMD.

Issue 2: Read-Only and Hidden Files

If you encounter a situation where you get an error message that the stick is read-only, or you find that you can't view some files, you can use CMD to resolve such issues.

Using a CMD utility known as Diskpart, you can remove the read-only attributes of files on any storage and clear the hidden status of hidden files.

Issue 3: Formatting

This refers to the process that completely deletes the storage media and recreates a file system. You can format a memory card using CMD, a device such as a phone or other PC utilities available in Windows. In CMD, the main way to do this is to use the Diskpart utility which we explain in the next section.

One important thing to note before you use CMD to repair or format a memory stick is to make a backup so you don't lose all your data. To back up, connect the memory stick to a computer and copy all the files to a folder on the computer. You can also back up your files to the cloud using a cloud storage app such as Google Drive, Dropbox, OneDrive, or any other preferred cloud storage service.


How to Format SD Card Using CMD

The instructions that follow are for how to format an SD card using CMD in Windows 10. It takes less than ten minutes to get this done and is one of the most robust ways to format an SD card.

To begin, connect your SD to your computer and make sure it is recognizable then follow the steps below.

Step 1: Open Command Prompt

Next, fire up Command Prompt by navigating to the Windows Search bar at the bottom left of your screen and type Command Prompt. Ensure you run it as an administrator, or you won't be able to execute commands.

launch command prompt

Step 2: Start Diskpart

Next, type diskpart and hit Enter. This will take you into a screen such as the one shown below.

start diskpart cmd

Step 3: List the Disks

Type, list disk, to identify your disk from a list of disks.

diskpart list disk

Step 4: Select your SD card from the list

Note your disk number and then type in the command select disk followed by the disk number. This will select your SD card.

diskpart select disk

Step 5: Clean the SD Card

Next, type the command clean and hit Enter. This command erases everything on the SD card.

diskpart clean disk

Step 6: Create a new partition

You now need to create a new partition on the memory stick. To do this, type in the command, create partition primary and hit Enter.

diskpart create partition primary

Step 7: Run the Format Command

Next, type in the command format fs=fat32 and hit the Enter button. The letters fs are an abbreviation for the file system whereas fat32 is the file system known as File Allocation Table. If you want your SD card to store files over 4GB, format it using exFAT.

diskpart format command

Step 8: Assign a drive letter

To complete the process, assign the SD card a drive letter so you can access it from Windows Explorer. Do so by typing, assign letter f. The letter can be any letter of your choosing.

diskpart assign drive letter

That's how to format a memory stick using CMD. But this isn't the only way, as mentioned, you can also format it using a phone or other features in Windows.


Tips When You Cannot Format Memory Card with CMD

Formatting an SD card using CD is one of the most powerful formatting methods. But there are a few instances when this may fail.

Why CMD Cannot to Format Memory Card

If you get an error message, then the following could be the causes. We offer some solutions on how to fix these issues.

Solution 1: The SD Card is Read-Only

In computing, read-only status refers to a situation where a computer file, memory, data, or a device is accessible via digital means but immutable. In this context, a read-only memory card means the contents can be read by device but you can't save any new content, delete or manipulate the existing content. In computer lingo, the device is write-protected.

There are two ways to turn off the read-only feature on a memory stick.

Physical Switch

The first method involves moving a physical switch on the card. Some cards come with this feature out-of-the-box. Examine the memory card and see if there is a lever that you can slide to turn-off the read-only.

remove sd card write-protect

Once you do this, try to format the SD card again.

Remove Read-Only Attributes

The second method involves removing write protection that has been introduced via a software command. This command is executable using a computer or encryption tools on a mobile phone.

Read-only attributes on an SD card cause the formatting process to fail. If you encounter an error message using the method provided in the section on formatting an SD card using CMD above repeat the steps and introduce an extra step:

Step 1 - Navigate to the Windows Search bar at the bottom left of your screen and type Command Prompt. Run as an administrator.

Step 2 - Type diskpart and hit Enter.

Step 3 - Type list disk.

Step 4 - Type in select disk followed by the disk number.

Step 5 - Type attributes disk clear readonly

Step 6 - Type clean and hit Enter. This command erases everything on the memory stick.

Step 7 - Type create partition primary and hit Enter.

Step 8 - Type format fs=fat32 and hit the Enter button.

Step 9 - Type assign letter f. The letter can be any letter of your choosing.

attributes disk clear readonly

You will notice we have introduced an extra command in bold above which is attributes disk clear readonly. This removes the write-protection feature on the SD card.

Solution 2: File System Corruption

If there is a problem with the integrity of the SD card file system or there are bad sectors on the SD card, then formatting may fail. In such a scenario, we recommend using the chkdsk command in CMD.

Chkdsk is the short-form of Check Disk. This is one of the most powerful utilities you can find in the command prompt. There are two instances when this tool can come in handy:

Begin by connecting the SD card to the computer and noting the drive letter in Windows Explorer.

To run chkdsk, open the command prompt from the Windows search bar.

Next, type chkdsk h: /f. H denotes the memory card drive letter while /f is a command parameter that instructs the utility to fix any errors found.

cmd chkdsk command

There are other parameters you can use with chkdsk to perform various functions. These include:

Chkdsk is a powerful tool, and it is recommended that you run it periodically on an SD card to keep it in tip-top shape.

Solution 3: SD Drive Letter Not Visible

To format an SD card in CMD, it must first be recognizable by the computer. Fix this by changing the drive letter using the Windows Disk Management utility. To do so, follow these steps:

change drive letter paths

Solution 4: Virus Infection

A computer virus can make a memory stick unusable. Connection to a PC may not be possible the PC itself may also be infected. You can tell that the memory card has a virus if all the solutions fail, and the card behaves abnormally.

To remove a virus, first, ensure the PC is free from viruses.

Install or update antivirus software on the PC and run a scan. Many free antivirus programs do a good job, they include AVG Antivirus and McAfee.

SD card virus scan

The antivirus program will scan and clean the PC.

Next, connect the SD card and scan it.

If there is a virus, the scan expunges it and you will get a message stating the same.

Once you get a clean bill of health, repeat the SD card formatting process.


Tips When SD Card Files Are Lost After Formatting SD Card

One thing you should do before formatting an SD card using CMD is to perform a data backup. The reason is that formatting erases all data and recreates the file system.

Failure to back-up could, therefore, leave you with a bad taste in your mouth when you realize you have lost all your favorite photos, videos, and important documents.

There are various ways to backup an SD card, these include:

But, in the event, you did not take this important step and lost all your data, do not fret, you can always turn to Wondershare Recoverit data recovery software.

To use the software, download it from the Recoverit webpage on the Wondershare website and install. Next, launch the tool by clicking the shortcut icon on the desktop or type "Wondershare Recoverit" in the Windows search bar, click and follow the steps below.

Step 1: Locate the SD Card

Once the application is up and running, locate the SD Card in the interface and click the Start button.

locate-sd-recoverit

Step 2: Scan the SD Card

The application scans the storage media to find lost files and begins the recovery process. You can see what's happening in real-time in the progress bar.

recover SD files Recoverit

Step 3: Recover the Files

In the next screen select the files you want to recover and click Recover. Save the selected files on a location on your computer.

Recoverit save files

Even though formatting erases all the data on a memory stick, the information is still retrievable using this special tool. The tool performs a deep scan of the memory card, reconstructs the deleted data, and lets you save the recovered files on a location on your computer.


Tips to Maximize the Usage of Memory Card

It is common for people to leave toss memory cards in desk drawers, leave them in hot and humid areas such as bags, or even leave them in hot cars. Little do they know that the life of a memory card depends a great deal on its usage and storage. The following are a few tips to maximize the usage of your SD card.

Use it on one device

While a memory stick is usable on many devices, it is not good to do so. If possible, use it only on one device, and if you need to use it on a different device, back it up and then format it first.

Avoid Magnetic Fields

Data stored on conventional storage devices are susceptible to destruction when it comes into contact with a magnetic field. Keep your storage media away from magnets and anything that produces a magnetic field.

Water, Dust and SD Cards Don't Mix

Dust is a big factor in any type of storage becoming ineffective. When storing the memory stick, keep it covered in a plastic container. The same goes for water. SD cards are not waterproof. Do not go into a swimming pool with them and avoid carrying them in the rain.

Just Be Good to It

Finally, use some common sense when taking care of memory sticks. Treat them the same way you would anything delicate. Do not subject them to physical impact and be gentle when inserting into a device.


Closing Words

The CMD utility is a powerful tool that executes various functions in Windows. The Microsoft Website has a detailed command line reference is you want to further your knowledge on using this utility. The diskpart command interpreter is a great way to manipulate local drives and removable media like SD cards. This tool would rarely not format the SD card in CMD but in the event, it does so, you can always follow the solutions provided to troubleshoot and fix the problem.

You Might Also Like

Recoverit author

Eleanor Reed

staff Editor

(Click to rate this post)

Generally rated4.5(105participated)

Home > Resources > SD Card Solutions > Terms and Tips on Formatting SD Card Using CMD