Recover deleted EXT3/EXT4 files

From Kolmisoft Wiki
Jump to navigationJump to search

About

Works for these filesystems:

  • Ext 3
  • Ext 4


It is very important to not recreate a lost file/folder!


There is not guarantee that these steps will recover your lost data!

Usage

It is very important not to use the hard disk where the data was deleted. So in order to achieve this remotely - we will create a partition in RAM:

mkdir /tmp/recovery
mount -t tmpfs tmpfs /tmp/recovery -o size=2048m  # <--- PUT here a number how much MB of RAM you would like to dedicate for this new partition
cd /tmp/recovery 
wget -c http://downloads.sourceforge.net/project/extundelete/extundelete/0.2.0/extundelete-0.2.0.tar.bz2?r=http%3A%2F%2Fextundelete.sourceforge.net%2F&ts=1331044068&use_mirror=freefr
tar xjvf extundelete-0.2.0.tar.bz2
cd extundelete-0.2.0
./configure
make
cd src

Now you have to specify what hard disk partition the program should use, for example /dev/sda1 - the exact one you will find with

df -h

For example:

[root@212 tmp]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                     374G  255G  100G  72% /
/dev/sda1              99M   19M   75M  21% /boot
tmpfs                  16G     0   16G   0% /dev/shm
You have mail in /var/spool/mail/root

Here we will have to use: /dev/mapper/VolGroup00-LogVol00

In this example we will try to recover deleted IVR voices:

./extundelete /dev/mapper/VolGroup00-LogVol00 --restore-directory /home/mor/public/ivr_voices

The recovered files if everything will be OK will be located in /tmp/recovery/extundelete-0.2.0/src/RECOVERED_FILES

See also