0

This question already has an answer here:

I accidentally deleted a few important work related folder from my Ubuntu 14.04. I wanted to recover them. All the options on net gives instruction for recovering files.

I tried scalpel but I don't remember any of the file names so i could not recover any files. Is there a way to list the folders i deleted and recover the one i wanted? I need these files please help me.

marked as duplicate by Panther, karel, user68186, Kaz Wolfe, Eric Carvalho Dec 17 '16 at 1:28

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.

  • How did you delete? The rm command? – Kaz Wolfe Dec 16 '16 at 18:40
  • please specify how to recover folders. – karthick Dec 16 '16 at 18:41
  • shift+delete so it is not in the trash. – karthick Dec 16 '16 at 18:41
  • boot a live usb ASAP and see help.ubuntu.com/community/DataRecovery . A directory is itself just a file with a list of the contents. – Panther Dec 16 '16 at 18:53
1

If you've permanently deleted a file (using something like rm or Shift-Delete), the file is still there, but marked as "free", meaning it can be overwritten by any other file operation. In order to prevent this data from being destroyed, SHUT DOWN YOUR SYSTEM NOW.

Boot into a live session (USB/CD/DVD/etc) and use a tool like foremost or photorec to attempt to pull the lost data from your drive. Do not mount the partition from your live disk. Operate on the raw block device itself.

You can get information about these two utilities using man photorec or man foremost after the eponymous packages have been installed to the live media.

Your folder itself is likely gone (as it's just virtual), but the files within might still be okay, but you might need to sort through a lot of cruft to find those files.

  • photorec is unreliable as it has no way of recovering fragmented files, and the recovery mostly ends by having corrupted files. Don't recommend it to others. – Kais Oct 15 '17 at 19:08
  • @user6039980 While this may be the case, photorec does work and has saved me and numerous other people many times in the past. Even if it's not the best tool, it's still better than nothing. – Kaz Wolfe Oct 15 '17 at 19:12
  • That might be true only if you are recovering text-based data, which can be simply done more reliably using grep. – Kais Oct 15 '17 at 19:36
  • For instance, partition recovery software can find deleted files from the filesystem - so even if the filesystem is fragmented, the user can view his deleted files directly from the software and get it 100% complete, not corrupted as what the file-signature data recovery (photorec and foremost case) does .. – Kais Oct 15 '17 at 20:03

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