Imagine you've spent all afternoon taking photos with your camera or saving important files to a microSD card, and suddenly your computer tells you that the drive It has no format Or that there's a reading error. It's a nerve-wracking moment, especially if you made the typical beginner's mistake of disconnect the card without using the Windows eject option, leaving the file system half-written.
Fortunately, there are open-source tools that are true technological miracles for these situations. We're talking about an inseparable pair: TestDisk and PhotoRecWhile one handles the disk structure, the other goes straight for the files, allowing us to save our skin even when the card seems to have completely died or is displayed as a unallocated space.
What exactly is TestDisk and what is it used for?
TestDisk is a cross-platform utility designed primarily for recover deleted partitions and troubleshoot boot problems. It's especially useful when software has crashed, hardware has a minor defect, or the partition table has been accidentally deleted. Its most powerful feature is its ability to work with hard drive imagesThis means that there is no need to touch the damaged card directly if we have a cloned copy.
Among its most outstanding capabilities we find the ability to Fix the Partition TableIt can rebuild boot sectors in both FAT32 and NTFS and locate the backup superblock in Linux systems such as ext2, ext3, or ext4. Furthermore, it is capable of recover files of deleted partitions, although for more complex cases of individually deleted files, its companion, PhotoRec, is usually recommended.
Step-by-step guide to using TestDisk
To begin with, you should know that TestDisk doesn't have a pretty graphical interface; it works through a command consoleThis might seem a little daunting at first, but it makes perfect sense once you get the hang of it. It's crucial to always execute it with Administrator privileges so that he/she has full access to the hardware.
- Home and registration: When you open the program, the first thing to do is choose whether you want to create a log file. Select Create If you want to save a history of the steps taken.
- Device selection: You'll see a list of all connected units. Use the arrows to select yours. SD or USB memory and hit Enter.
- Partition type: The program usually detects the motherboard type automatically (such as Intel or EFI GPT). In the vast majority of cases, the option Intel will be the correct one.
- Analysis and search: Enter the menu Analysis and then choose Quick Search. Aquí TestDisk buscará particiones que hayan desaparecido. Si los archivos aparecen correctamente al pulsar la tecla ‘p’, ya casi lo tienes.
- Deep search: If the quick search doesn't yield results, don't give up. Use DeeperSearch, which analyzes each cylinder of the disk and looks for backups of the boot sector.
- Change writing: Once you have located the correct partition, use the option Write to save the new structure to the disk. After restarting, your data should be accessible again.
Boot sector and MFT repair
Sometimes the partition is there, but the system can't read it because the NTFS boot sector It's corrupted. In these cases, TestDisk can compare the main sector with the backup. If the backup is valid, you can choose Backup BS to overwrite the damaged sector and bring the unit back to life.
If the problem is more serious and the MFT (Master File Table)which is basically the database where Windows file systems They save the location of each file; it's corrupted. You can use the Advanced menu and select Repair MFTThe program will attempt to rebuild the master table using its backup mirror.
PhotoRec: The lifeline for deleted files
When the file system is so corrupted that TestDisk can't repair it, PhotoRec comes into play. Unlike its sibling, PhotoRec ignores the file system and directly searches for data signatures on the disk. This means it can recover photos and videos even if the card has been erased. reformatted.
In Windows, we have QPhotoRecwhich is the version with a graphical interface and is much more user-friendly. You just have to choose the drive, select the partition (even if it appears as damaged), and define a destination folder on your computer. It is vital that you never save the recovered files to the same SD card, as you could overwrite data that you are trying to save.
You can configure PhotoRec to search only in the free space (useful for accidentally deleted files) or that scans the whole albumIt is capable of recognizing hundreds of formats, from JPG and TIFF to RAW files from professional cameras such as Canon's CR2.
Advanced tips and alternatives
For those who work in Linux, a very secure technique is to use ddrescue Before anything else, this tool creates a mirror image of the SD card, handling bad sectors without stressing the hardware. Once you have the .img file, you can run TestDisk on it. disk image instead of working on the physical support, preventing the memory from dying permanently during the process.
If you find the command line too complicated, there are commercial alternatives like PartitionAssistant Recovery. These tools offer a visual interface and deep automatic scans, although these aren't always free. However, for most users, the free TestDisk and PhotoRec combo is more than enough. retrieve the information.
This set of tools allows you to fix everything from a simple read error to rebuilding entire partitions or extracting files from raw sectors, as long as the data hasn't been overwritten. The key is to act quickly, avoid writing anything new to the damaged memory, and ideally, work from a backup or cloned image to ensure maximum data security.




