Recover the original file once removed

Hi All,

Is there is any machanisim, once delete the file can we restore it.

Thanks

You must start this question by specifying your exact operating system, version number, etc.

Redhat linux enterprise edtion 18 version

Did you delete a file already and you are trying to recover it?

Or. are you hoping to write some code to make this "deleted file recovery" possible when after someone uses the rm command?

i tried to use rm -rf command.

So, you ran rm -rf is what directory, on your Linux RedHat system, exactly?

Also, what filesystem are you using? ext2 ?

I have not tried this... so YMMV but if you are using the ext2 filesystem on your Linux RedHat system, you can try testdisk.

https://www.cgsecurity.org/wiki/TestDisk

According to their wiki, TestDisk can:

  • Fix partition table, recover deleted partition
  • Recover FAT32 boot sector from its backup
  • Rebuild FAT12/FAT16/FAT32 boot sector
  • Fix FAT tables
  • Rebuild NTFS boot sector
  • Recover NTFS boot sector from its backup
  • Fix MFT using MFT mirror
  • Locate ext2/ext3/ext4 Backup SuperBlock
  • Undelete files from FAT, exFAT, NTFS and ext2 filesystem
  • Copy files from deleted FAT, exFAT, NTFS and ext2/ext3/ext4 partitions.

(but I have never tried this... so I cannot say "good" or "bad"... or how it works, you are on your own)

See this page to recovered deleted files in the ext2 filesystem:

https://www.cgsecurity.org/wiki/TestDisk:_undelete_file_for_ext2

Let us know if you are going to try this route, or if you have other plans.

Of course, if you had a backup, that would be the FIRST AND BEST option.

Do you have a backup?? Do you make regular backups?

Note: You should make a full backup of the disk you are have problems with before running "recovery" utilities and programs.

Note: I always make a full backup of my system before installing new drivers, upgrades my OS, or other major changes, so I always have a version I can safely return back to if I have a disk problem. You should do the same.

Thanks... i will go through the link

Please answer our (well considered) questions..

Next time we will not help you until you take the time to answer the simple questions we ask (there are reasons to ask for details).