ok, thanks. I found the following on the page I downloaded
https://www.cgsecurity.org/testdisk.pdf
"Recover deleted files
TestDisk can undelete
files from ext2 filesystem,
I see it says "ext2 filesystem". Mine is ext4. For other extensions, it says use "photorec". I see somewhere it says something about downloading libraries. Am I supposed to download a "libary" ...?
If I need to use "photorec" - I tried "apt-get install photorec" but it didn't work.
Without attaching the external hard drive - I tried 'testdisk' steps on my ubuntu 17.10. It is currently running though I am attempting to copy 1 file and picked "downloads" to store it. It says "copying, please wait...250,000 ok, 15 failed. I thought I was just trying to copy 1 file...????
----------QUESTION: is ubuntu inherently ext2 or ext4?
----------------if it is not ext2 - don't know why this 'seems to be' working.
===============================================
BUT IF I NEED TO USE PHOTOREC........
***** I'm stuck at 11.1 --- how do I get started w/ photorec? I don't think photorec is installed. I typed in the command directly below but just got error messages...
==========================================
PHOTOREC:
Running TestDisk, PhotoRec under Linux
You need to be root to run TestDisk.
cd testdisk-7.0
sudo ./testdisk_static
cd testdisk-7.0
sudo ./photorec_static
Note: If your Raid device (ie. Intel raid) is missing, run “sudo dmraid -ay” to activate it.
6
==========================================
DIRECTIONS FOR PHOTOREC:
Recovering deleted files using PhotoRec
PhotoRec doesn’t recover the original filenames or the file structure but it can recover lost files even from corrupted filesystem. PhotoRec is a signature based file recovery utility (a file carver) and may be able to recover your data
where other methods failed. Remember, you must avoid writing anything on the filesystem that was holding the data. If you do, deleted files may
be overwritten by new ones.
11.1 Start photorec
• Running TestDisk, PhotoRec or QPhotoRec under Windows
• Running TestDisk, PhotoRec under Linux
• Running TestDisk, PhotoRec under Mac OS X
6.3 Running TestDisk, PhotoRec under Linux
You need to be root to run TestDisk.
cd testdisk-7.0
sudo ./testdisk_static
cd testdisk-7.0
sudo ./photorec_static
Note: If your Raid device (ie. Intel raid) is missing, run “sudo dmraid -ay” to activate it.
11.2 Disk selection
Available media are listed. Use up/down arrow keys to select the disk that holds the lost files.
• Use up/down arrow keys to select your hard drive with the lost partition/s.
• Press Enter to Proceed.
Hint for Mac OS X: If available, use raw device /dev/rdisk* instead of /dev/disk* for faster data transfer.
11.3 Source partition selection
Choose
• Search after selecting the partition that holds the lost files to start the recovery,
35
TestDisk Documentation, Release 7.1
• Options to modify the options,
• File Opt to modify the list of file types recovered by PhotoRec.
11.4 PhotoRec options
• Paranoid By default, recovered files are verified and invalid files rejected. Enable bruteforce if you want
to recover more fragmented JPEG files, note it is a very CPU intensive operation.
• The expert mode option allows the user to force the file system block size and the offset. Each filesystem
has his own block size (a multiple of the sector size) and offset (0 for NTFS, exFAT, ext2/3/4), these value are
fixed when the filesystem has been created/formated. When working on the whole disk (ie. original partitions
are lost) or a reformated partition, if PhotoRec has found very few files, you may want to try the minimal value
that PhotoRec let you select (it’s the sector size) for the block size (0 will be used for the offset).
• Enable Keep corrupted files to keep files even if they are invalid in the hope that data may still be
salvaged from an invalid file using other tools.
• Enable Low memory if your system does not have enough memory and crashes during recovery. It may be
needed for large file systems that are heavily fragmented. Do not use this option unless absolutely necessary.
11.5 Selection of files to recover
In FileOpts, enable or disable the recovery of certain file types, for example,
[X] riff RIFF audio/video: wav, cdr, avi
...
[X] tif Tag Image File Format and some raw file formats (pef/nef/dcr/sr2/cr2)
...
[X] zip zip archive including OpenOffice and MSOffice 2007
The whole list of file formats recovered by PhotoRec contains more than 300 file families representing more than 480
file extensions.
11.6 File system type
Once a partition has been selected and validated with Search, PhotoRec needs to know how the data blocks are
allocated. Unless it is an ext2/ext3/ext4 filesystem, choose Other.
11.7 Carve the partition or unallocated space only
PhotoRec can search files
• from the whole partition (useful if the filesystem is corrupted) or
• from the unallocated space only (available for ext2/ext3/ext4, FAT12/FAT16/FAT32 and NTFS). With this option
only deleted files are recovered.
36 Chapter 11. Recovering deleted files using PhotoRec
TestDisk Documentation, Release 7.1
11.8 Select where recovered files should be written
Choose the directory where the recovered files should be written. Use the arrow keys (up, down, left, right) to navigate,
you can also use the enter key to enter into a directory.
• Dos/Windows/Os2: To get the drive list (C:, D:, E:, etc.), use the arrow keys to select .., press the Enter key
- repeat until you can select the drive of your choice. Validate with Y es when you get the expected destination.
• Linux: File system from external disk may be available in a /media, /mnt or /run/media sub-directory.
Mount your destination drive if necessary.
• Mac OS X: Partitions from external disk are usually mounted in /Volumes.
Warning: Do not store the recovered files on the source filesystem. Otherwise lost data may be overwritten and definitively lost.
11.9 Recovery in progress
Number of recovered files is updated in real time.
• During pass 0, PhotoRec searches the first 10 files to determine the blocksize. This step is skipped when
searching files from the unallocated space only, the blocksize value found in the filesystem structure is
used.
• During pass 1 and later, files are recovered including some fragmented files.
Recovered files are written in recup_dir.1, recup_dir.2... sub-directories. It’s possible to access the files even if the
recovery is not finished.