Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
    
Try this askubuntu.com/questions/33800/…? –  atenz Jun 14 '12 at 6:50

2 Answers 2

up vote 12 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
2  
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 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
1  
I would use a comment for this... –  hexafraction Aug 8 '12 at 12:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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