0

I put some 8Gb MicroSD card in Video Recorder and recorded some video onto it. Then I got a message, that card is full. I plugged it into computer's card reader and saw, that card was full of Android filesystem files from some old device. Also I found two video I just recorded. I saw these videos and at the moment I was watching second one I got a message, that data is unreadable.

After that when I am looking at the card I only see System Volumne Information directory from Windows and one big 3.5G file with garbaged name. This file probably encapsulates entire flash card content.

I can't open or copy this file.

How can I restore data in this situation?

marked as duplicate by music2myear, phuclv, Mark, djsmiley2k, Tetsujin Sep 4 '18 at 8:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Sounds to me like your SD card is corrupted. How old is it? Especially older SD cards and those from lesser-known brands tend to age quickly. I would suggest you to follow step 1. of my tutorial below first, before you take any further action. Then I would use chkdsk or similar tools to try and repair the drive. You might also wanna try testdisk to repair the filesystem. If nothing works....

For recovery you can use my following tutorial: (If you don't have Linux installed, a live USB (e.g. xubuntu) will do fine.)

1. Create an image of the drive

This is a pretty important step that will prevent you from doing even more damage than good. This is a good idea even before you proceed to try and fix the drive. The file recovery we will do later will be performed on the disk image, instead of the real disk. To create a disk image, simply issue the following command: (Status flag is optional, it shows the progress statistic as dd is running)

$ sudo dd if=/dev/sdX of=image.dd bs=1M status=progress

Replace X with your drive letter. (You can find it out with lsblk)

2. Perform file recovery

There are plenty of recovery applications, personally I find that photorec and foremost work best. photorec is usually part of the testdisk package. On debian, you can install both as followed:

$ sudo apt-get install testdisk foremost

a) Photorec

Simply run $ photorec image.dd now to open up photorec's interactive interface.

Hit return ([Proceed]) to select the disk image. In the next screen, you're asked to select a partition. If photorec finds the correct partitions, you can select the one you want to recover the files from here. If it doesn't detect the partitions properly, simply select No partition [Whole disk] and hit return again to perform the [Search]. Once selected the filesystem type in the next screen, you need to select a directory in which the recovered files should be saved. Confirm with C.

Once it's done, proceed with step 3.

b) Foremost

While photorec works by trying to find "data blocks" of the drive and media within using file carving, foremost does it a bit differently. It's still using the file carving concept but it ignores the type of underlying filesystem and directly works by copying segments of the drive into your RAM, which is then being scanned for file header types. Foremost comes with a lot of built-in headers to recover most types of common files, if you want to add custom headers/footers to detect less common file types, foremost offers you this ability.

To run foremost using the default options on the image, run the following command:

$ foremost -i image.dd -v

That will save all recovered files into output (new directory that foremost will create). You can specify another output directory using the -o flag, and -a to ignore errors/save corrupted files.

3. Filter the recovered files

This is optional, but sometimes you are only interested in specific types of files, or even worse: Recovery tools give you a million of files out of which thousands appear to be, for example, a JPEG file, but in reality it's just a corrupted file and not a picture at all. To filter these out you can use this answer I gave to another question on SuperUser.

  • So should I flag the question as duplicate? The cases are a bit different, and there might be different explanations for the cause that might be of interest, however both ask about recovery and my answer applies to both in that regard. – confetti Aug 8 '18 at 11:18
  • 1
    My opinion: The question is "how can I restore?", not "why?", therefore different possible explanations shouldn't matter. So yes, if you believe your another answer does answer both questions then you should flag one of them as duplicate. In general if you notice a substantial difference in questions and still your other answer may help, a link to it will be better than repeating the whole thing. If you can address the difference then write a specific answer with the link. If you cannot address the difference then leave a comment with the link. The point is not to repeat yourself. – Kamil Maciorowski Aug 8 '18 at 11:39
  • Alright, got it. I'll raise a flag and leave a comment in the future. Sorry, I'm still pretty new around here. – confetti Aug 8 '18 at 11:42
  • 1
    No worries. @confetti. We all started somewhere. Your contributions are pretty good. Keep up the good work. – music2myear Aug 14 '18 at 18:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.