The cause is that I accidentally deleted the source files of the entire project that I had worked hard to complete in one academic year. At that moment, I really wanted to have an impulse to death. Although this project is very large, there are tens of thousands of lines of C language code, and many of them are constructed to receive or send network data packets in bytes, every time I tried to debug bugs with GDB, my first reaction was to find a software to recover.
Software can be downloaded from http://www.cgsecurity.org/wiki/PhotoRec_CN.
This software can be used in many systems and supports most hard disk formats. It can be said that data can be restored without being overwritten, and the speed is quite fast.
Introduction:
Photorec
It is a data recovery software used to restore files such as lost videos, documents, and compressed files on hard disks or CDs, or to recover lost images from a digital camera memory card (therefore, this software is named photo
Recovery ).
Photorec can directly recover data from the bottom layer of the media by ignoring the file system. Therefore, it can recover data after the file system of the media is seriously damaged or re-formatted.
Photorec is a free open-source, cross-platform data recovery software.
. Photorec is testdisk
Testdisk is a data recovery software that supports the recovery of lost partitions in multiple file systems and can repair non-boot disks. You can
Download the program.
For security reasons, photorec visits the disk or storage card medium where you want to recover data in read-only mode.
Important: once an image or file is lost or accidentally deleted, do not save the new file to the storage device or disk. Otherwise, the original data may be overwritten. This means that when you use photorec, you do not need to write the recovered files to the same partition where the original data is stored.
Usage:
The following uses Linux as an example.
After the download is complete, there will be two softwarePhotorec
AndTestdisk
Here we will only introduce the former
1. Change the file photorec_static in the Linux folder to an executable file.
$ Chmod + x photorec_static
2. Run the software as root and select the hard disk you want to scan. The value is/dev/SDA.
$ Sudo./photorec_static
3. After selecting the hard disk, all your partitions will be listed. This is the LINUX partition, and then you can enter file OPT
To define the file type to be scanned
4. Define the scan file type. We recommend that you select unnecessary file types to reduce the scan time and storage space.
5. Select the back folder to save and recover data (you must scan other hard disks outside the hard disk, for example, get a USB file to save it; otherwise, the original data will be overwritten, leading to recovery failure.
)
6. After the folder is selected, Press Y to start, or N to end the current operation and return
7. The scan may last for a period of time, depending on the scan range. Because there are many files, you can run the Linux Command to check the excluded file range, for example, in the back folder,
$ Cat */*. txt | grep Google
*
To view all TXT files that contain Google strings
I will not explain it here
Reference link:
Http://www.cgsecurity.org/wiki/TestDisk
Http://blog.csdn.net/nankong/archive/2009/05/16/4193810.aspx