Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I've been using Ubuntu 12.04 and accidentally deleted a folder using Shift+Del.

Does anyone have any idea how to recover the folder?

share|improve this question

marked as duplicate by Eric Carvalho, Charles Green, muru, Elder Geek, bcbc Nov 30 '14 at 5:55

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.

Try this…? – atenz Jun 14 '12 at 6:50
up vote 16 down vote accepted

Yes, you can use extundelete command. (extundelete is a utility to recover deleted files from ext3/ext4 partition.)

Note that the partition must be unmounted before you recover. In most cases, you will have to shut down your computer and boot using an Ubuntu LiveCD/LiveUSB to be able to this.

Steps to recover:

  • Install extundelete with:

    sudo apt-get install extundelete
  • Usage example:

    sudo extundelete --restore-directory /home/myself/Documents/deleted_folder/ /dev/sda1
  • The /dev/sda1 is the device name where the deleted data was.

share|improve this answer
Also note that if installing extundelete touches the partition on which you want to recover data, the fact that changes were made to that partition could potentially make recovery more difficult. – Michael Kjörling Jun 14 '12 at 12:02
@Frantique - I have run Ubuntu via LiveCD, but I can not install extundelete: E: Unable to locate package extundelete, how to solve this? – Ladislav Nado Dec 11 '13 at 8:07
You have to enable universe repo to install it. – Frantique Jan 21 '14 at 15:15

However did you know that extundelete on Ubuntu 12.04 (Precise) has an important bug, possibly only on 64 bit machines, inherited from the Debian build (#670815) which causes a general protection fault whenever you try to undelete files?

Coincidentally, extundelete from source 0.2.0-2 (with the patch mentioned in the bug above) will fail to compile correctly on Ubuntu 12.04 x64 (./configure runs fine, if not briefly; checkinstall fails completely with an error revolving around ext2fs.h lines 944/215).

This breaks one of the fundamental advantages of Linux and the ext3/4 filesystem. Does anyone have a Debian package (.deb) which will install successfully on 12.04 64 bit?

Or can someone help to put pressure on the maintainers of the (admittedly excellent) extundelete tool so this works properly in an LTS Ubuntu?

share|improve this answer
I would use a comment for this... – hexafraction Aug 8 '12 at 12:30

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