Forum Discussion
How can I recover files from a formatted hard drive?
Formatting does not erase data immediately, but only resets the file system index. By scanning the hard disk sectors at the bottom level, there is still a chance to recover files from a formatted hard drive, but the following conditions must be met:
No new data is written after formatting (otherwise old files may be overwritten)
Use a tool that supports raw data extraction
Windows command line solution
1. Use chkdsk to repair the file system (logical damage only)
chkdsk X: /f /r
(X is the hard disk drive letter, which may repair some index errors, but cannot directly recover files from a formatted hard drive)
2. Use the testsdisk tool (cross-platform)
Download address: https://www.cgsecurity.org/wiki/TestsDisk
Operation steps:
testdsisk -> Select hard disk -> [Proceed] -> [Intel] -> [Analyse]
Recover files by analyzing the partition table (supports NTFS/FAT/exFAT), suitable for partition reconstruction after recovering files from a formatted hard drive.
macOS command line solution
1. Use ddrescue to create an image backup
sudo ddrescue /dev/diskXsX ~/disk_image.img ~/disk_log.log
(Create an image first to avoid secondary damage, then scan the image file through other tools)
2. Extract files through photosssrec
photosssrec /dev/diskXsX
(Specializes in image/document recovery, supports 200+ formats, suitable for extracting fragments after recovering files from a formatted hard drive)
4. Precautions
Stop using the hard drive immediately to avoid data overwriting
It is recommended to save the recovered files to other storage devices
It is recommended to create a disk image before complex operations (such as using the dd command).