Testdisk cannot undelete individual files from every filesystem.
The documentation states that individual files can only be undeleted from the following file system types:
1.3 TestDisk - File recovery When a file is deleted, the list of disk clusters occupied by the file is erased, marking those sectors available for use by other files created or modified thereafter. If the file wasn’t fragmented and the clusters haven’t been reused, TestDisk can recover the deleted file for various filesystem:
• FAT
• NTFS
• exFAT
• ext2
For other filesystems or if sought-after lost files are still missing, give PhotoRec a try. PhotoRec is a signature basedfile recovery utility and may be able to recover your data where other methods failed.
PhotoRec was already installed on my system, either by default or due to having just installed testdisk. It was also pretty intuitive to use, similar to TestDisk: photorec, then use the menu to recover your files.
Warning:photorec creates a bunch of /recup_dir/ folders in the directory you're recovering from.
Part 2: Use grep -ri 'my string' to recursively find a string in the contents of a file, if that's what you need.
Testdisk cannot undelete individual files from every filesystem.
The documentation states that individual files can only be undeleted from the following file system types:
Testdisk documentation
In line with CuriousIndeed's answer, the PDF mentions at the beginning of chapter 8:
PhotoRec
was already installed on my system, either by default or due to having just installedtestdisk
. It was also pretty intuitive to use, similar to TestDisk:photorec
, then use the menu to recover your files.Warning:
photorec
creates a bunch of/recup_dir/
folders in the directory you're recovering from.Part 2: Use
grep -ri 'my string'
to recursively find a string in the contents of a file, if that's what you need.