Thanks again to Falko Timme's HowTo: "Recover Deleted Files With Scalpel".
And another nice source for info on data rescue (on GNU/Linux) is the "Data Recovery" article on Ubuntu's community wiki.
Let's proceed:
1) Extract exact image of original medium:
Very often, I have to deal with SD cards, because they are now commonly used as recording media on digital photo cameras, as well as audio recording devices.
I take a 1:1 image of the source medium, in order to work on a copy - and leave the original medium as untouched as possible.
In case of an SD-card, this is easily possible, because the image filesize is usually <= 64GB.
When dealing with harddisks, it's very uncommon that you have the necessary free space left on your local disk to make an image copy.
This is especially important, when there is indication that the SD-card may have gone bad. For example the partition (usually FAT/FAT32) cannot be mounted anymore, because it's corrupt.
Code: Select all
$ dd if=/dev/sdX of=$OUTPUT_FILE
In order not to confuse rescued images later on, I use a naming like this:
Example:sdcard-$DATE-$SIZE-$ORIGINATOR_$COMMENT.img
Code: Select all
$DATE = "20160520" (Date format: "YYYYMMDD" / This lists in chronoligical order when sorted alphabetically in the file explorer)
$SIZE = "08GB"
$ORIGINATOR = "mediathek"
$COMMENT = "deleted_recordings"
Code: Select all
sdcard-20160520-08GB-mediathek-deleted_recordings.img