A learning experience is one of those things that says, ‘You know that thing you just did? Don’t do that, Douglas Adams.
Did you accidentally delete some vacation photos, lovely and unforgettable family pictures, important office documents, multimedia or other files, do not panic,at least not yet.
If you have deleted your files and folders by mistake or accident, because you did not think you were going to need them, or if your computer got fried after a power outage or a storm, you are not the only one -just follow these instructions and do not panic! First, you should read our first article How to recover deleted files.
If your Windows does not boot up normally, create a Linux bootable USB, boot from it, and try to access and recover your files.
TestDisk is a powerful free data recovery software. It can run under Windows, GNU/Linux, and macOS. It is an ideal tool when you want to recover files from corrupt and damaged partitions or unbootable systems.
Abandon hope all ye who enter here, Dante Alighieri
SafeCopy is one of the best tools when everything else fails and data seems to be completely unrecoverable. The utility copies data to a new location and tries to extract data from damaged media.
sudo safecopy /dev/sdb1 dataRecover.iso --stage1
After that, you may want to try to mount dataRecover.iso. If you are running out of luck and no recovery files are to be found, try sudo testdisk. Select a media (/dev/loop0), hit Continue even if write access isn’t available. You may likely want to go with Intel/PC partition, Advanced, and select the Undelete option.
Success! Select the location where recovered files should be copied, and that’s all folks! 😄
Would it save you a lot of time if I just gave up and went mad now?, Douglas Adams.
Sometimes, you need to recover the partition table: sudo testdisk. Select a media (e.g., /dev/loop0 or /dev/sda), and hit Continue even if write access isn’t available. This option is not always there, but depends on the situation.
You may likely want to go with Intel/PC partition, Advanced, Analyse the current partition structure and search for lost partitions, choose the Quick search option to locate partition tables, select or highlight the found partition, and press INTRO to proceed with recovering the partition table.
Use the up/down arrow keys to select your hard drive with the lost partition/s. Examine your current partition structure for missing partitions and errors. In my particular case, Windows has created a system reserved partition (* indicates primary bootable, [System Reserved]), the system partition (P indicates primary partition), and a recovery partition.
If everything looks good to you, choose the Write option to recover it, then Y to confirm these changes, quit the tool, and reboot.
PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from hard disks, CD-ROMs, and lost pictures from digital camera memory.
sudo photorec dataRecover.iso
You may want to select File Opt to choose the type of files you want to recover, e.g., doc, gif, jpg, kpbx, etc., then hit Search.
To recover lost files, PhotoRec needs to know the filesystem type where the file were stored: Ext2, Ext3, and Ext4 are all file systems created for GNU/Linux. Windows uses NTFS and FAT/32, and Mac OS uses HFS+.
Typically, the default options are the best way to go.
From now on, it is quite the same process as with previous recovering tools, search for a location to save the recovered files to, and press c when the destination is correct.
Bibliography: Digital Ocean, Top 20 Best Linux Data Recovery Tools to Recover Deleted/Corrupted Files
If you have not been able to recover your data yet, it is likely to be a mechanical failure of your drive, then you need a professional disk drive repair service. “Unless the damaged drive has extremely valuable data on it, it is a more secure and cost-effective option to purchase a new drive rather than repair the damage one,” Platinum Data Recovery.