How to Fix and Recover Data: SD Card, USB Drive, Hard Disk

Are you unable to use files on your storage medium?

Don’t worry friends.

In this post, I will show you step-by-step how to recover data and fix your storage medium.

YouTube player


This guide works for the following scenarios:-

  • You accidentally deleted your files
  • You accidentally formatted your drive
  • Your storage medium like SD Card,  USB Drive, Hard Disk got corrupted

We have divided this how-to guide into two parts:-

  1. Recover Your Data
  2. Fix Your Storage Medium

List of Prerequisites

1. Testdisk and Photorec Utility

These two utilities are open source and are excellent for data recovery purpose. In fact, forensic data retrieval experts use this software. You can download these two utilities here

2. Windows 7/8.1/10 system

In this tutorial, we have used inbuilt windows system utilities. A non-windows system user can also use this tutorial with some changes.

3. Administrative rights on the System

To run the above utilities, administrative rights on the system is essential.

4. You have to connect Storage Medium to the System

For USB powered storage medium this is not a problem. But if you are using this guide for an SD card or an Internal Hard Disk then you would need a Card Reader or SATA to USB Adapter.

5. Patience

That’s right guys patience is a must. This tutorial might take a bit of time, but I will be there to help you step-by-step so be with me my friends and everything will be right.

Identifying a Corrupted File System

If your file system does not have any problem you can recover your deleted files in lesser time. So to find a faulty file system you can look out for these symptoms which are a telltale sign of a corrupt file system.

  • When you insert the storage medium it doesn’t get detected
  • It detects the drive, but it shows no files in it
  • It shows an error message something like this

You need to format the disk in drive E before you can use it. Do you want to format it?

When to Use TestDisk and Photorec for File Recovery

If your storage medium does not show any of the above signs, then you can recover your deleted files using TestDisk Utility. But if your file system is corrupt, you can still recover data using Photorec Utility. Also, you can Repair the disk using TestDisk Utility.

Navigation in TestDisk Utility

Use the left, right, up and down arrow keys to change the selection. Some screens have special buttons to do a particular action I will mention them below when we need to do those actions.

Part #1: Recover Your Data

Step 1: Connect the storage medium to the computer
Step 2: Extract the testdisk and photorec utility
Step 3: Recover Data using PhotoRec Utility
  1. Open Qphotorec.exe
  2. Select your storage medium disk in PhotoRec
  3. Select the Whole Disk entry in the list of partitions
  4. Check if the Correct File System Type is Selected
  5. Select the Location to Save the Recovered Files
  6. Select the File Formats to look for (Optional)
  7. Click the Search Button

Warning: Depending upon your disk capacity this task can take a significant amount of time i.e. Couple of hours

Step 4: Recover Data using TestDisk Utility
Select Disk in TestDisk
  1. Open testdisk_win.exe
  2. Select Create a new Log File
    • Keep the default selection on create and  hit Enter. This can be useful if you later want to troubleshoot a problem.
  3. Select your storage medium disk in TestDisk
    • Use the top and down arrow key to select the disk, when selected, hit enter to continue.
  4. Select Partition Table Type
    • Usually, test disk detects the partition table type correctly so you can go with the detected partition type as shown in the hint below and hit enter.
  5. Select Advanced Filesystem Utils
    • Press the down arrow key to select Advanced and hit enter.
  6. Select the Partition to Undelete Files
    • From the list of partitions, select the partition which you want to recover the deleted files use the up and down arrow key to navigate.
    • Once selected using the right arrow key to select Undelete option in the menu shown below.
Search for Deleted Files
  1. Browse the Drive and Select the Deleted Files
    • Navigate the selected partition using right arrow key to change directory.
    • To find a directory view the code next to the file name if it starts with a d then it means that it is a directory.
    • You will see deleted files shown in red color.
    • Select the red colored deleted files/directory by using the down arrow key and then type the colon.
    • On most keyboards, you can type a colon by using Shift + ; .
    • On selecting a particular file/directory it will turn green.
  2. Copy Selected Files to the Recovery Location
    • After you  have selected all the deleted files/folders that you want to recover press capital C (shift + c).
    • Now you have to navigate to the folder in which you want to save the recovered files.
    • The default location would be the same place from where you have started the test disk program.
    • You can create a directory named Recovery in the same location of the testdisk_win.exe and select it using the down arrow key.
    • Once selected, you need to press capital C (Shift + c) to copy the recovered files into this directory.

Part #2: Fix Your Storage Medium

Step 1: Fix Storage Medium using TestDisk
Select Disk in TestDisk
  1. Open testdisk_win.exe
  2. Select Create a new Log File
    • Keep the default selection on create and hit Enter.
    • This can be useful if you later want to troubleshoot a problem.
  3. Select your storage medium disk in TestDisk
    • Use the top and down arrow key to select the disk, when selected, hit enter to go ahead.
  4. Select Partition Table Type
    • Usually, test disk detects the partition table type correctly so you can go with the detected partition type as shown in the hint below and hit enter.
  5. Select Analyse
    • Keep the choice on Analyse and hit enter.
Recover Partition Table
  1. Select Quick Search
    • On this screen, you will be shown the current partitions on the disks.
    • There might also be some warnings which you can ignore.
    • Keep the selection on  the Quick Search and hit enter.
  2. Browse Newly Detected Partition(s)
    • The utility will give a list of  partitions. From this list, you have to find the partition which was present originally.
    • Browse through the contents of the partition and check if the files that are shown are the same as the ones that had been deleted.
    • To browse through the files select the partition using the up and down arrow key.
    • Once selected, type capital P (Shift + p) to open the partition and browse through the files using the left-right arrow key.
    • Once confirmed to go back press q and then hit enter.
    • If no new partition was detected in quick search or the partition detected was not the one that you want to recover.
    • Then press enter and read the next point 8 Deeper Search.
  3. Select Deeper Search (Optional)
    • Using the left and right arrow key select deeper search and hit enter.
    • It  will take some time to scan your disk.
    • Once the utility finishes scanning, you will be again shown a list of newly detected partitions.
    • To find which partition to select browse their contents using Capital P (Shift +p).
    • Browse through the files using the left-right arrow key.
    • Once confirmed to go back press q and then hit enter.
  4. Select Write
    • You should be 100% sure that the selected partition is the correct one before you select to write it.
    • Once verified, using the left-right arrow key, select the write option and hit enter.
Step 2: Backup Storage Medium
  1. Create a backup directory
  2. Copy All the files from your storage medium
  3. Paste all the files in the backup directory
Step 3: Format Storage Medium
  1. Right click the drive select format
  2. Select all the default setting
  3. Check quick format
  4. Select Start
Step 4: Repair Storage Medium using chkdsk
  1. Open CMD in Admin Mode
    • In windows 7
      1. Click start type cmd in start
      2. Right click the cmd program and click on Run As Administrator
      3. If a UAC pops up select OK
    • In Windows 8.1 and Windows 10
      1. Right click the start button
      2. Select command prompt admin
  2. Type the command chkdsk/x /r x:
    • Here x: is the drive which represents your storage medium
  3. Hit Enter

I hope this step-by-step guide helped you recover data and fix your storage medium. If you liked our blog you can subscribe to our newsletters for updates. Thanks for reading see you later goodbye.

Neil Mahaseth

Hello, friends welcome to HowISolve.com, a community founded by me in June 2015. With the aim to help you solve your everyday tech problems. The motivation for starting this community was instilled from my love for technology and my nature to help others in need. By qualification, I am a technocrat with an M.B.A. and B.Tech. from Narsee Monjee, Mumbai. I have experienced both worlds: corporate and startup. I am currently honing my entrepreneurial skills and trying to add value to people's lives. You can also join us by subscribing to our Newsletters & YouTube channel to be a part of this growing community.

View all posts by Neil Mahaseth →