How to fix/repair corrupted USB flash drive/Pen drive/SD card using CMD (command prompt)?

By Katrina | Posted to Data Recovery, updated on Apr. 8th, 2019 |

This article talks about how to fix the corrupted USB flash drives/Pen drives or SD cards using CMD (command prompt), such as CHKDSK and Diskpart. You can also follow the tutorial to recover data from corrupted USB drives/SD cards with iBoysoft Data Recovery.

One of the more common computer-related issues that more and more users appear to be encountering on a regular basis is a corrupted SD card or damaged USB flash drive. SD cards or USB drives related issues may be common, but they're still incredibly annoying and can make life very difficult indeed. That's because, such media store a wide variety of different types of info on them, so keeping them in perfect working order is hugely important. With that said, however, sometimes they do wind up becoming damaged or corrupted for no apparent reasons. Does this mean that you should give up with them? Absolutely not. You can even fix a corrupted SD card or USB drive using Windows built-in tool - Command Prompt (CMD).

Let's go into detail.

What are SD cards?

If you're wondering what the SD stands for in S-D card, it basically means 'security digital'. These cards are basically utilized to store a variety of information for users. These cards are used in mobile devices such as smart phones, tablets, and cameras and they can potentially be incredibly important in certain situations. To cut a long story short, SD cards are utilized to store data, and transfer it from one medium to another. To give an example, professional photographers may use one of these cards in their digital cameras. They will snap hundreds, if not thousands, of photographs of a special event, and will then store the images on the SD card. Next, the SD card can be taken and placed into a computer where the photos can be imported onto the computer and professionally edited.

Now, picture the scene:

You're a wedding photographer. You've been hired to photograph a couple's special day. You get hundreds of amazing images, store them on your SD card and can't wait to import them onto your computer and start editing them to look even better. You remove the SD card, you place it into your computer and your heart sinks and your stomach feels as if it's in your mouth as you get an error message stating that the SD card is corrupted. You need those images as without them, the couple's special day is ruined, as is your reputation, and your chances of getting paid. Thankfully, if your SD card is damaged or corrupted, there are things you can do to restore it, and we'll be looking at those a little later on.

What are USB Flash drives?

As well as dealing with SD card issues, we're also going to be looking at common USB flash drive problems today as well. USB flash drives, or Pen drives, thumb drives, are basically small, portable electronic devices used for storage purposes. The devices have a built-in USB type-A plug that slots directly into a USB port. These devices basically serve the same purpose as SD cards, in that they're used to store data and info and transfer it from one device to another. USB flash drives can be used to store files, like audio files, images, videos, written documents, and much more besides. Basically, if you think of them as digital filing cabinets, you're on the right track. As these things are technological, they do sometimes go wrong and damaged or corrupted USB flash drives are unfortunately quite common, such as the USB flash drive not showing files and folders when connected to computers. Luckily, there are things you can do if you do happen to encounter any issues regarding your USB flash drive, and again, it's what we're going to be looking at for today's article.

Common problems on SD cards and USB flash drives

As you now know, SD cards are sometimes prone to damage or corruption, as are USB flash drives. Recently, we received an email from one of our users who was overcome with worry because her SD card appeared to be corrupted. Take a look at what she had to say and see if any of the issues she raised in her email sound familiar to you.

"Hi, Guys, I really hope you can help me. Recently I returned home after having one of the greatest holidays of my life. I took plenty of photographs and videos on my camera, and naturally, stored them on my SD card. The next morning, eager to see some of the pictures on a large screen, I inserted the SD card into my computer, only to be greeted with an error message. The message stated that 'The disk is not formatted. Do you want to format it now'? Many of the files on the card were very important so I didn't format the SD card. I'm now panicking as I really don't want to lose any of the photos stored on the card. Please, guys, is there anything I can do to fix this corrupted SD card, or can I just recover photos from the SD card?"

As you can see, she was quite distressed, and for good reason too. Thankfully, instead of throwing in the towel, she did reach out to us and we were able to help her retrieve all of the important images and videos of her and her family, that clearly meant so much to her.

Besides that, we have also received other SD card or USB flash drive related issues include:

  • SD card not formatted;
  • Damaged SD card;
  • SD card infected with virus;
  • USB flash drive not recognised by computer;
  • USB flash drive incorrect capacity;
  • Cannot format USB flash drive, and so on.

How to fix a corrupted SD card and USB flash drive using CMD?

Now it's time for us to look at what you can do to repair a corrupted SD card or USB flash drive using CMD. There are actually a number of things you can try here, so the good news is that you do still have plenty of options.

Before we can proceed any further, we need to draw your attention to the fact that using CMD to fix corrupted USB flash drives, SD cards, or any other type of storage devices for that matter, could potentially wipe all files stored on the device in question. To avoid data loss, ensure you have a backup, or alternatively, download iBoysoft Data Recovery to ensure that data loss isn't an issue for you.

Video tutorial: How to fix corrupted USB/SD cards using CMD?

Method 1: Fix corrupted/damaged USB flash drives or SD cards using CHKDSK

The first CMD method we're going to look at today for repairing an SD card or USB flash drive is to utilize CHKDSK command. If you find that your SD card is corrupted or damaged, the first thing you should do is utilize Windows chkdsk /f command prompt to perform a check disk error. This method could help to keep your important files intact and potentially repair a corrupted SD card or flash drive and make the files accessible once more.

However, CHKDSK may also delete files, too. So, please make sure you have a backup copy.

  1. Step 1: Begin by plugging your SD card or USB flash drive into your computer via an SD card reader or USB flash drive cable.
  2. Step 2: Next, make your way over to the start menu, type 'cmd' in the search bar, right click on 'cmd.exe' and then choose 'Run as Administrator.
  3. Step 3: Now, you will need to type 'chkdsk *: /f /r /x, replace * with the drive letter you wish to repair. As an example, if you wanted to repair the G drive, you would need to type in chkdsk G: /f /r /x.

Hopefully, that should then work. It is also worth noting that CHKDSK is not available for RAW drives. If you receive a message stating something to this effect, try method 2 instead.

What is RAW file system?

RAW file system is basically a state of your chosen storage device, or the computer's hard drive, which currently has no known Windows file system such as FAT32 or NTFS. Because the file system is RAW, it basically means that you are unable to access folders or files on the drive, plus you cannot use it to store any data. Thus, to fix a device showing as Raw file system, you may need to convert RAW to NTFS, FAT32 or any other recognizable file systems. We will tablk about it later.

Method 2: Fix corrupted/damaged USB flash drives/SD cards using Diskpart

Now we're going to look at how you can repair a corrupted SD card or USB flash drive utilizing Diskpart command. If you're looking to repair a corrupted USB flash or SD card without having to reformat, utilizing Diskpart command is very effective in a lot of cases. The thing to remember here is that all data on the corrupted SD card or USB flash drive will be wiped. This basically means that if there is anything on the device that you do wish to keep, you should not go with Diskpart command. So we recommend you to use Diskpart only if you have no important files on the device in question.

Step 1: Plug in your SD card or USB flash drive to the computer.

Step 2: In the search box, type in 'Diskpart' and then right click on it and then select 'Run as Administrator'.

Step 3: Next, type 'List disk' before pressing 'Enter'. According to the list disk information, check which disk is your corrupted SD card. For example, disk 2.

Note: Just remember that Diskpart is basically just like reformatting, so all data, important or otherwise, will be removed if you go with this process. So, select the wrong command can actually cause harm to your data and even your computer. This is why it's vital to ensure that you've selected the right command.

Step 4: Now, you will need to Type 'format fs=ntfs' and press enter. If you would prefer other file system formats, simply change the command ntfs to your desired one, such as FAT32, exFAT, etc.

Method 3: Fix corrupted USB drives/SD cards by reformatting

Finally, we have what many people consider to be most effective solution of all. This is reformatting the corrupted SD card or USB flash drive. However, if you have tons of important files on the device, you need to firstly perform SD card data recovery or USB drive data recovery.

iBoysoft Data Recovery is a free USB drive data recovery that is able to recover data from corrupted/damaged SD cards, and also able to recover data from corrupted hard drives, USB drives, Pen drives, memory cards. What's more, it can also recover data from inaccessible, unrecognized, unreadable, formatted drives and deleted or lost partitions, and plenty more on top of that.

Step 1: Recover data from corrupted USB drives/SD cards

1. Download and install iBoysoft Data Recovery on your computer. The software is completely free to install.

2. Launch iBoysoft Data Recovery, choose the corrupted or damaged SD card and click "Next". The program will then start to scan for misplaced files on the corrupted SD card.

iBoysoft Data Recovery

3. During, or indeed, after the scanning process, you will have the ability to preview the scanning results and select the individual files that you want to recover.

iBoysoft Data Recovery

4. Click the "Recover" button to recover data from corrupted SD card.

5. Now, check to ensure that all lost data has been recovered.

Step 2: Reformat the corrupted USB drives/SD cards

After the data recovery has been completed, you should then right click the SD card in My Computer/Computer/PC and select "Format" or click 'Run Disk Management' to format your SD card.

More about iBoysoft Data Recovery

There are countless examples of free data recovery pieces of software out there for you to choose from, but some are unfortunately not very reliable, nor are they that effective. Finding a reliable and trustworthy piece of free data recovery software is essential, which is why iBoysoft Data Recovery comes so very highly recommended. It is considered by a number of users to be the absolute best free data recovery software option on the market today. This software is ideal, in that it supports the recovery of the following: deleted photos, deleted videos, audio files, images, text files, and more.

These can be recovered from external hard drives including: USB drives, SD cards, memory cards, Pen drives, and more. What's more, the software is able to recover deleted files, recover data from lost partitions, from formatted external hard drives, and much more besides. It is simple to use, very effective, and best of all is the fact that the software can be downloaded and installed completely free.


Katrina is a data recovery expert @iBoysoft who loves to help readers solve various data recovery problems.

Scroll down for the next article Scroll down