Background
Has your SD card been damaged, causing you to lose all your data? Don’t worry! In this guide, you can learn how to repair the corrupted SD card using CMD command prompt tools like chkdsk or Diskpart without losing data.
Table of Contents:
"I wanted to format the sd card yesterday, but I don’t know why Windows failed to format the card, and the device became inaccessible, the device showed 0 byte, I know this means the sd card got corrupted. I have important data on the sd card, is there any solution to repair the damaged sd card without data loss?"
How to repair the corrupted sd card without data loss? It is not that hard if you are an advanced user. However, we won't recommend computer starters to repair sd card using cmd since it is a little complicated that can easily get lost or the cmd won't work for you.
CMD command prompt diskpart is a Windows system tool which can perform a lot of operation performance. If your device becomes raw drive, then you can use CMD command prompt diskpart to repair it. You just need to convert the file system from raw to NTFS, FAT32, or other file system. But you need to know there are some risks when you use this system command operation tool.
Attention:
You need to pay attention to the process when you use CMD command prompt, which can make your another hard drive get formatted by mistake.
This process will erase every file on your memory card, you need to recover them at first before using cmd. How? iCare Pro Free is able to help, which is listed at the third part of this article.
Preparations:
Start cmd
Note: If you type 'cmd' or 'CMD' in the run box to open, next you will need to type 'diskpart' in the coming up window to start the journey of diskpart.
CMD Way 1 - format * /fs:fat32
Type “format F: /fs:fat32” (F is the drive letter that you need to replace with your own corrupted sd card drive letter that you need to open your computer to check which drive letter does your computer assign it with before all the steps.)
Repair damaged sd card using cmd
CMD Way 2 - List volume, select, format
This way of cmd does not require any drive letter from you that can be selected in the listed volumes
Repair corrupted sd card with cmd diskpart
CMD Way 3 - List disk, clean, create partition primary, format
Repair corrupted sd card with cmd diskpart
After these steps, you can convert your device file system into FAT32, you can also change the FAT32 into NTFS if you want to convert your file system into NTFS.
This operation will format your disk, if you have important data on it, recover them first.
If your SD card becomes inaccessible, you can try CHKDSK to check the disk.
CHKDSK is able to fix errors on digital devices that you may use in the following way.
Preparation: Open your computer 'This PC' and then see what drive letter the computer has labeled your memory card.
* /f - Fixes errors on the disk.
chkdsk E: /f
chkdsk E: /f /r
/f /r
but also forces the volume to dismount before scanning.
chkdsk E: /f /r /x
In addition to CHKDSK, there are other CMD commands that can help recover a damaged SD card. Below are the common commands:
diskpart
and press Enter.list disk
to see all the disks connected to your computer.select disk X
(replace X with your SD card number).clean
to remove all partitions and data on the SD card.create partition primary
to create a new primary partition.format fs=fat32 quick
to format the SD card to FAT32.exit
to close DiskPart.sfc /scannow
and press Enter.Follow these steps to manage attributes on your SD card using CMD commands. Ensure you replace "X" with the correct drive letter for your SD card. Be cautious, as changing attributes can affect file visibility and access.
cmd
Launch Command Prompt by searching for "cmd" in the Start menu and selecting it.
attrib X: +r +h +s
This command sets the SD card to read-only, hidden, and system attributes. Replace "X:" with your SD card’s drive letter. This can help protect the SD card from accidental modifications.
attrib X: -r -h -s
To reverse the previous attributes and make the SD card writable, visible, and not a system file, use this command. Replace "X:" with your SD card’s drive letter.
attrib +r +h +s X:\* /S
This command applies the read-only, hidden, and system attributes to all files and subdirectories on the SD card. Replace "X:" with your SD card’s drive letter.
attrib -r -h -s X:\* /S
This command removes the read-only, hidden, and system attributes from all files and subdirectories on the SD card. Replace "X:" with your SD card’s drive letter.
Replace "X" with the appropriate disk number for your SD card. Use these commands with caution, especially the format command, as it will erase the data on your card.
IM-Magic Partition Resizer is freeware that can repair damaged SD cards for free. It offers features to repair damaged SD cards with IM-Magic Partition Resizer, repair, or format SD cards. Here are the key features of IM-Magic Partition Resizer:
Part 1: Repair damaged SD card in Partition Resizer with its "Check Partition" feature.
Part 2: Clone the damaged SD card to another drive for free using Partition Resizer
Part 3: Remove SD card write protection using Partition Resizer
Part 4: Format SD Card using Partition Resizer
Note: Formatting will erase all data on the SD card, so please back up your data first.
Part 5: Regenerate SD Card by Erasing using Partition Resizer
Warning: This method will completely erase the data on the SD card, and the old data will be irrecoverable, even with professional recovery software. Please back up your data before proceeding.
Before using CMD Diskpart to repair the corrupted SD card, it’s recommended to recover your data with a professional recovery tool like iCare Data Recovery Pro. This program is 100% safe and can handle various data loss scenarios. It is compatible with Windows 11/10/8/7/XP/Vista.
Follow these simple steps to recover your data:
Step 1: Download and install iCare Data Recovery on your computer.
Step 2: Run the program and select “Deep Scan Recovery”.
Recover corrupted SD card data with iCare Data Recovery Pro
Step 3: After scanning, preview the found data, select what you need, and save it to another drive.
Recover corrupted SD card data with iCare Data Recovery Pro
Be sure to save the recovered data to a different location to avoid overwriting the SD card. If you’ve already formatted the SD card, iCare Data Recovery Pro can still help recover the data. However, it’s best to recover your data before using any CMD commands.
Recommend: 8 free SD card repair tools instead of using Command Prompt to repair damaged memory cards.
Last updated on Sept 10, 2024
Related Articles