How to Repair a Corrupted SD card / USB Hard drive

If your PC does not detecting your SD card or USB flash drive and you are thinking of buy a new one, just wait and try this before spending bucks on the new one. When we inserted a corrupted flash drive into the USB port and try to access it, it shows an error like this:

                 You need to format the disk in drive before you can use it.

When you click on the Format Disk and start the format, it displays the following error:

  Windows was unable to complete the format.

Windows was unable to complete the format
windows cannot format drive

If you also have similar kind of problem with your SD card or External hard drive or USB flash drive, then keep reading. I am going to demonstrate a method to fix corrupted storage devices. The windows was unable to format the disk because it has no specific file system (e.g. NTFS, FAT) associated with it. This drive is called RAW drive and it can be repaired by formatting the disk.

NOTE: Before moving further, please note that this will remove all data from your SD card/ flash USB drive permanently. If you have some important data, you can try some hard drive data recovery tools before trying this. There are many hard drive recovery softwares available for free which can recover data from USB drives and external hard disks.

Before trying this method to repair your SD card, I would suggest you to try my previous method as it is easy and safe to perform. If that not work for you, you can come here and follow the below steps. Here is the link to my previous post.

Windows Was unable To Complete The Format-How to solve this

How to Format a Raw SD Card

If you are sure you do not have any important files on your drive and want to repair it by formatting, follow these steps:

1. Plug your drive into the USB port of your PC. Make sure only the damaged / corrupted SD card or USB flash drive is connected to PC and remove any other removable storage devices.

2. Then Open the Computer window and note down the drive letter. As you can see in my case it is D .

corrupted sd card

3. Press Win Key + R to open Run box and type cmd. Hit enter and Command prompt window will launch. You can directly open command prompt by using the shortcut Win key + X and choosing Command prompt.
run command
4. Type diskpart and press enter. An warning message will show up, just click Yes and a new command prompt window will open with heading DISKPART. Now, you need to type all the commands in this window. 

5. Type list disk in order to list all the disk drives connected to your System. Detect your drive by its size as one will be of huge size(your Internal hard disk) and other will be your SD card/ USB flash drive. That’s why I asked you to remove all the other drives from your system.

corrupted hard disk recovery

6. Next, you need to choose your corrupted disk drive. Perform this step very carefully because if you select the wrong disk number by mistake, it can remove all the data from your internal hard disk. Type select disk “your disk number” . As you can see, In my case it is Disk 2 of size 8 GB, so I will type select disk 2 and hit enter.

external hard drive recovery

7. Next type clean and a message will displayed that Diskpart succeeded in cleaning the disk.

hard drive recovery

8. Next you need to type the command – create partition primary and hit enter. A success message will be displayed.

Repair a Corrupted SD card

9. After this type active and hit enter. 

sd card data recovery

10. Now you need to execute the command select partition1

11. Finally, we are going to format the drive with file system FAT32. So type format fs=fat32 and press enter.

external hard drive data recovery

12. It will start formatting your drive. It will take quite a long. Just minimize it and wait for format completion.

When the format completes (100%), close the command prompt window and go to Computer in order to check the drive. Verify your drive by copying some data in it.
By this method, you can repair your corrupted SD cards, USB flash drives and even your External hard drives. Again, after performing above steps you will lose all your previous data. So, if you have some important data in your drive, try to recover it first using hard drive recovery software. Here is the summary of all the above performed operations in order:

-diskpart 
-list disk 
-select disk ‘your disk number’ 
-clean 
-create partition primary 
-active 
-select partition 1 
-format fs=fat32

Hope this help you in repairing your corrupted SD card, hard drive or flash drive. Let me know whether it worked for you or not via comments.

Recent Articles

Related Stories

154 Comments

    • Tried to select partition primary and it came back with virtual disk service error: the operation is not supported on a non-empty removable disk

  1. I am getting an error
    DiskPart has encountered an error: The request could not be performed because of an I/O device error.
    See the system event log for information

    Can you help as what to do next.

  2. I am getting an error when I type "create primary partition" and hit enter. It says "No usable free extent could be found……… and then finally it says "It may be that the disk is partitioned using MBR disk partitioning format". Please help,
    One More thing. I am trying this process on my 8gb micro sd card. Though the size is 8gb it only shows up as 30MB when I select the disk! Is the card beyond any scope of repair ?? do help !

  3. i m getting this error ,I am getting an error when I type "create primary partition" and hit enter. It says "No usable free extent could be found……… and then finally it says "It may be that the disk is partitioned using MBR disk partitioning format". Please help me

  4. i have also an problem —diskpart has encountered an error: the parameter is incorrect. see the system event log for mor information ,,,also used chkdsk in command prompt but said that this is raw drive and it does not work with raw drives what can I do

  5. I get this …"No usable free extent could be found. It may be that there is insufficient free space to create a partition at the speciffied size and offset. Specify different size or value or don.t specify either to create the maximum sized partition. It may be that the disk is partitioned using MBR disk partitioning format and the disk contains either 4 primary partitions or 3 primary partitions and one extended partition ". I have a USB flash drive of 16 GB … and i`m kinda desperate … any other solutions ? Thanks in advance.

    • No usable free extent could be found. It may be that there is insufficient free space to create a partition at the specified size and offset. Specify different size and offset values or don’t specify either to create the maximum sized partition. It may be that the disk is partitioned using the MBR di sk partitioning format and the disk contains either 4 primary partitions, (no more partitions may be created), or 3 primary partitions and one extended partition, (only logical drives may be created).

    • @Amar pawar: I did exactly what you said above for my 2GB Sandisk microSD card that is in my D: drive slot (for SD cards) – chkdsk D: /f
      It said: “The type of the file system is RAW. CHKDSK is not available for RAW drives.”

  6. When I go through the clean command, my 32gb SD card unmounts/disconnects from the computer as soon as "DiskPart succeeded in cleaning the disk" is done so you can't go any further [it no longer shows up in list disk]… what does this mean/? I have to remove then reinsert the card and all data is still there, can't format like before cant' erase/rename any file? Can't do anything … thanks for any help [PS my screen name is about rugby, not anything else!… lol]

  7. I have to format my sd card. I followed the steps shown above but encountered a problem after clean step. It shows " DiskPart has encountered an error: Data error < cyclic redundancy error> .See the system event log for more information.
    Please help me.

  8. Sir
    When i type create primary partition, it says "No usable free extent could be found. It may be that there is insufficient free space to create a partition… the disk contains either 4 primary partitions, (no more…) or 3 primary partition and one extended partition, (only logical drives may be created).
    i am working this on my 16gb sandisk micro sd card (instead it is showing only 8 mb when i type list disk)
    I have read the previous comments but nothing did help me.
    please be kind enough in resolving this for me.!

  9. for anyone with the

    ."No usable free extent could be found. It may be that there is insufficient free space to create a partition at the speciffied size and offset. Specify different size or value or don.t specify either to create the maximum sized partition. It may be that the disk is partitioned using MBR disk partitioning format and the disk contains either 4 primary partitions or 3 primary partitions and one extended partition "

    i found a simple work around. when you're getting that message try these commands;

    list partitions
    select partition 1

    then continue on from the "active" command step (step 9)

  10. i m facing this error after typing create partition primary…
    ."No usable free extent could be found. It may be that there is insufficient free space to create a partition at the speciffied size and offset. Specify different size or value or don.t specify either to create the maximum sized partition. It may be that the disk is partitioned using MBR disk partitioning format and the disk contains either 4 primary partitions or 3 primary partitions and one extended partition "

    Help me plzzz

  11. Mine is external hard disk (1TB) and I got the error after format command:

    0 percent completed

    Virtual disk service error:
    The volume size is too small.

    Any other workaround?

  12. Log Name: System
    Source: Disk
    Date: 1/29/2015 4:28:44 PM
    Event ID: 7
    Task Category: None
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: THE_RAIN
    Description:
    The device, DeviceHarddisk1DR2, has a bad block.
    Event Xml:

    7
    2
    0
    0x80000000000000

    15813
    System
    THE_RAIN

    DeviceHarddisk1DR2
    040668000100000000000000070004C0000100009C0000

  13. In my case, Im using my external hard drive which is 1TB, I cant proceed to diskpart because after I click format disk, windows says, "Windows can't format F".. due to read only. I dont know what to do then. How can i fix this? Help please! Thanks..

  14. I have an 8GB sdcard that was previously setup for a Raspberry Pi with the NOOBS software. I went through the steps outlined here with no errors encountered. Using Windows 7 I copied my NOOBS files over to the "clean" 8GB partition and popped it back into the RPi2 and booted it up. However, I did not get the option of installing multiple OSs as I would expect, so I abandoned the install. It appears that the original MBR is still intact on this sdcard and is trying to boot into some sort of recovery mode. On inspection the sdcard now has 3 partitions one has been named "Recovery". How do I wipeout the original MBR? Or is there something else I'm missing?

  15. i am unable to do the step "create partition primary"
    when i given that command it is showing " unable to create partition primary due to insufficient storage"
    as my SD card is 2 GB, but it is showing only 30 MB.
    pls suggest me some other method.

  16. i am unable to do the step "create partition primary"
    when i given that command it is showing " unable to create partition primary due to insufficient storage"
    as my SD card is 2 GB, but it is showing only 30 MB.
    pls suggest me some other method.

  17. Hi
    I have given command is "Clean" in this i got error is:
    Diskpart has encountered an error: The device is not ready.
    See the System event log for more information:
    Please tell me how to solve this?

  18. I think its pretty clear by now that the person who started this doesn't know jack shit about repairing a corrupted USB/SD/HDD … from what I've read its usually a physical damage to the unit and no longer repairable, copy any documents off and call it a loss

  19. the size of the pendrive is displayed as 5632B whereas its is a 4GB drive. secondly, on giving the "clean" command, an error message is displayed – " The semaphore timeout period has expired. See the system event log for more information"
    What to do?

  20. I am getting this error as well – The request could not be performed because of an I/O device error. I have done the chkdsk and got a critical error. Does this mean my sd card is beyond repair? What now?

  21. the type of the file system is0 fat32

    volume memory card iscreated 5/19/2015 2:37 pm
    volume serial no is 0000-b424
    windows is verifying files and folders………
    /playlists first allocation unit is not valid. the entry will be trauncated

  22. Hello,
    I have same problem:
    My micro sd card file system became RAW;
    formatting or changing file system wont work;
    when i try change file system by creating new volume as FAT, getting error message: Device is not ready, same error using cmd commands. anyone know any sollution?

  23. sir after running the command "create partition primary" a succees msg is not displaying on the cmd window so that next cmd "active" is also not displaying any msg and next command "select partition" says no partition selected sir how to resolve this plz help me sir –

  24. I have a 64GB microSDXC with a healthy primary partition and RAW file system that refuses to format. I've tried Diskpart and get this:

    "DiskPart has encountered an error, See System Event Log for more information.

    I did this, and found the error message in the log. It sounds pretty ominous:

    Cannot zero sectors on disk \?PhysicalDrive4
    Error Code: \?PhysicalDrive4

  25. for those who have tried this and other methods with no success i suggest you check out recoverfab.com. my 32gb micro sd in my samsung note was accidently formatted and after the format became corrupted somehow. i tried every method imaginable to recover my data with no luck whatsoever. i must have downloaded and ran over 30 different recovery programs (easeus, recuva etc…) and most wouldnt even recognize the card at all. chkdsk showed it as raw so i tried to reformat the card and windows couldnt even detect it. showed 0 bytes used, 0 bytes detected. after scouring the web for days and endless frustration i learned the card was most likely physically damaged. i contacted recoverfab about my issue and they replied right away with a quote and how to proceed. i went down to ups and mailed my card away (from oregon to germany so it took about a week) they were able to recover %100 of my files and the whole process was rather quick and painless and priced quite reasonably. i tried to find a company in the u.s. who did this and none i contacted could do recovery on a micro sd card.

  26. I have this error "virtual disk service error ,the file type is can't formatting,see system log for more information " when I boot windows 8, how I solve this problem using cmd ,plessssssssssssssssssssssssss elp me my dr frnds

  27. My pendrive become blank. It ask me to "Please insert a disk into Removable Disk (G:)" What should I do from here? and is there a possible way to recover the files formatted? Because I thought is just repair and i formatted it with your guide.

  28. I have the same problem, but that is because USD disk is locked/write protected (there is no lock button on it). How can I unlock it?
    (In Disk management, option to delete partition is disabled on that drive)

  29. hai my error is not as listed above
    i have completed entire process. after 100% the message pop up
    it is some what like this
    Diskpart has encountered an error:the parameter is incorrect.
    see the system event log for more information

  30. hai my error is not as listed above
    i have completed entire process. after 100% the message pop up
    it is some what like this
    Diskpart has encountered an error:the parameter is incorrect.
    see the system event log for more information

  31. my SD card was not shown in the "list disk".so I tried typing " chkdsk I: /f " (my drive letter is I ) but it shows an error that "Cannot open volume for direct access" plzzz help me

  32. Try fix it with HDD regeneration v1.71 support HDD,flashdisk,sdcard,Hd ext and much and support al format type ntfs,fat,fat32,UNFORMAT,and UNPARTITIONED too.this program easy to use 😀
    1.instal hdd reg ( plug card reader or usb cable data if needed )
    2.select ur sd
    3.process
    4.Hdd reg showed on cmd mode
    5.Select ur sd
    6.Scan and repair and type M
    7.Wait scaning.. will show how much bad sector and repaired on sd
    8.ur sd ready to use normaly 🙂 if all bad sector repaired u got sd without lose data :).Good luck

  33. Hi,
    I was able to follow all the steps till "create partition summary" where it said "No usable free extent could be found." I have an 8 gig microSD so I'm not sure what's happening. (It also initially said the size of my microSD was 30mb under "list disk" when it clearly is not.) Maybe it's time to get a new SD card?
    Thanks anyway.

  34. error

    an error occured when clean th disk asking
    '"vartual disk service error:.
    clean is not alowed on the disk containing the curren boot system,pagefile,crashdump or hibarnation volume

    sir please give me solution

  35. FAT 16 (FAT) FAT 32 exFAT (FAT 64)
    Maximum file size 2GB* 4GB 2TB (limited by card)
    SD Card type SD SDHC, microSDHC
    SDXC, microSDXC

    PC Compatible OS Windows ME/2000/XP/7/8.1
    Windows ME/2000/XP/7/8.1
    Windows XP/Vista/7/8.1

    Notes
    Windows OS may require updates, please see Table 2 below

    Mac Compatible OS
    Mac OS 8/9/X
    Mac OS 8/9/X Mac OS X 10.6.5 and above

  36. Run these steps/commands
    1. Open command prompt as administrator
    2. Diskpart
    3. List disk
    4. Select disk X (where x is the disk you want to partition/format)
    5. Clean
    6. Create partition primary size=30000 (where 30,000 is the size in MB you want the partition to be, under 32GB)
    7. Select partition 1
    8. Active
    9. Format quick fs=Fat32
    10.Assign
    11.Exit

  37. DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt
    ——– ————- ——- ——- — —
    Disk 0 Online 113 GB 0 B
    * Disk 1 Online 31 GB 0 B *

    DISKPART> select disk 1

    DISKPART> clean

    DISKPART> create partition primary

    DISKPART> select partition 1

    Partition 6 is now the selected partition.

    DISKPART> FORMAT FS=NTFS

    100 percent completed

    DiskPart has encountered an error: The parameter is incorrect.
    See the System Event Log for more information.

    DISKPART>

    please tell me how to solve ???

  38. Your suggestion to recover from RAW worked on my 1tb disk. I followed your instructions up to the point of selecting Partition. Saved my 1tb disk that had been causing me many hours of trial and error to format. Thanks for your information.

  39. sir ,

    i got following error

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\admin>DISKPART

    Microsoft DiskPart version 6.1.7600
    Copyright (C) 1999-2008 Microsoft Corporation.
    On computer: CHILTON-NEW

    DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt
    ——– ————- ——- ——- — —
    Disk 0 Online 465 GB 9 MB
    Disk 1 Online 29 GB 0 B

    DISKPART> select disk 1

    Disk 1 is now the selected disk.

    DISKPART> clean

    DiskPart succeeded in cleaning the disk.

    DISKPART> create partition primary

    No usable free extent could be found. It may be that there is insufficient
    free space to create a partition at the specified size and offset. Specify
    different size and offset values or don’t specify either to create the
    maximum sized partition. It may be that the disk is partitioned using the MBR di
    sk
    partitioning format and the disk contains either 4 primary partitions, (no
    more partitions may be created), or 3 primary partitions and one extended
    partition, (only logical drives may be created).

    DISKPART>

    • i got error

      Microsoft DiskPart version 6.3.9600

      Copyright (C) 1999-2013 Microsoft Corporation.
      On computer: DE

      DISKPART> list disk

      Disk ### Status Size Free Dyn Gpt
      ——– ————- ——- ——- — —
      Disk 0 Online 465 GB 1024 KB
      Disk 1 Online 14 GB 0 B

      DISKPART> select disk 1

      Disk 1 is now the selected disk.

      DISKPART> clean

      DiskPart succeeded in cleaning the disk.

      DISKPART> create partition primary

      No usable free extent could be found. It may be that there is insufficient
      free space to create a partition at the specified size and offset. Specify
      different size and offset values or don’t specify either to create the
      maximum sized partition. It may be that the disk is partitioned using the MBR di
      sk
      partitioning format and the disk contains either 4 primary partitions, (no
      more partitions may be created), or 3 primary partitions and one extended
      partition, (only logical drives may be created).

  40. dude plz help me….

    I am getting an error when I type “create primary partition” and hit enter. It says “No usable free extent could be found……… and then finally it says “It may be that the disk is partitioned using MBR disk partitioning format”. Please help,

  41. I done all the method to format my Sd card but after create the partition primary this error will come “No usable free extent could be found……… and then finally it says “It may be that the disk is partitioned using MBR disk partitioning format”. I also use safe mode to complete this method but this I can’t find the solution can any body help me… I also use the different type of recovery software but it cannot solved my problem.

  42. yes i m use this command to the cmd prompt ,,,,,,this command is useful then my corrupted memory card it’s working properly ..solved this problem easily………@@@ thank you friends

  43. I am getting an error
    DiskPart has encountered an error: The request could not be performed because of an I/O device error.
    See the system event log for information

    Can you help as what to do next

  44. I can’t access after create partition primary, I am getting error “there is no disk selected to create a partition select a disk and try again”

  45. I tried the same method written above but in my case, it is not working. Can you tell me about any other method to format USB?

  46. i done this method but it dos’nt work because this a big error comming after the command ” create partition primary” for me

  47. It worked for me. thank you very much. my files is RAW and cannot be format. Just followed your instruction and BOOM. it worked.

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox