Friday, May 12, 2017

Lets try recovering a file from rm *

By mistake I deleted a source code which I spend around a day to develop. With the help of extundelete utility it is possible to recover file if same space is not reallocated by file system.

Here is what I did to recover my deleted file info_bootimg.c

sudo src/extundelete --restore-file  workspace/utils/helper_utills/bootinfo/info_bootimg.c  /dev/mapper/vg00-lv_local_mnt

"workspace/utils/helper_utills/bootinfo/" is the path relative to the root of partition

This is where the partition is mounted,

/dev/mapper/vg00-lv_local_mnt on /local/mnt type ext4 (rw)

File's absolute path is "/local/mnt/workspace/utils/helper_utills/bootinfo/info_bootimg.c"

But you have to strip "/local/mnt" to get it working.

Download extundelete from,
http://extundelete.sourceforge.net/

./configure and make

No comments: