Using Data Recovery Tools in Linux
Stop Using the Drive
Immediately stop using the drive to prevent further data overwriting.
Identify the Overwritten Part
Determine how much data the ISO has overwritten. Typically, writing an ISO will overwrite the beginning of the drive, including the partition table and some initial sectors.
Use Data Recovery Tools
You can try using data recovery tools that work well on Linux:
- TestDisk: This tool can help recover lost partitions and make non-booting disks bootable again. It can also recover deleted files from FAT, NTFS, and ext2 filesystems.
- PhotoRec: This companion tool to TestDisk specializes in recovering lost files, including videos, documents, and archives from hard disks, CD-ROMs, and lost pictures from memory cards.
- ddrescue: A data recovery tool specifically designed to recover data from damaged disks. It can create a disk image and then work on the image to recover data.
Steps to Recover Data
- Install Recovery Tools:
sudo apt-get install testdisk photorec gddrescue
- Create a Disk Image: It’s safer to work on a disk image rather than directly on the hard drive.
sudo ddrescue /dev/sdX /path/to/image.img /path/to/logfile.log
Replace
/dev/sdX
with your external hard drive’s identifier. - Run TestDisk:
sudo testdisk /path/to/image.img
Follow the on-screen instructions to analyze and recover lost partitions.
- Run PhotoRec:
sudo photorec /path/to/image.img
This will guide you through recovering individual files.