Data Recovery

I just deleted a very important folder for which I do not have a recent backup.
Is there any way to try to recover the deleted folder. The folder was in a ext4 partition and my system (tumbleweed) is running on a BtrFS.
I tried restoring a previous snapshot, out of desperation, but no joy.
Any help will be greatly appreciated.

I don’t know how to do that with “ext4”. Your chances are not good. That’s why you should keep backups.

Hi
You could try photorec…


zypper if photorec

Information for package photorec:
---------------------------------
Repository     : Main Repository (OSS) 
Name           : photorec              
Version        : 7.0-1.15              
Arch           : x86_64                
Vendor         : openSUSE              
Installed Size : 1.1 MiB               
Installed      : Yes                   
Status         : up-to-date            
Source package : testdisk-7.0-1.15.src 
Summary        : Tool to Undelete Files
Description    :                       
    PhotoRec is a file data recovery software designed to recover lost files
    including video, documents and archives from hard disks and CD Rom and lost
    pictures (Photo Recovery) from digital camera memory. PhotoRec ignores the
    filesystem and goes after the underlying data, so it works even if your media's
    filesystem is severely damaged or reformatted.

I will give it a try right away…Thanks!!!

+1 photorec.
But, I highly recommend if you value your data to first clone the partition where the data resides and work off the copy so that if youmake a mistake, you haven’t destroyed the data you’re trying to recover. Maybe even make a second copy.

Then, if you want to guard against this kind of problem again in the future, I highly recommend extundelete

http://extundelete.sourceforge.net/

Last I used it many years ago, extundelete only worked on the first disk in a multi-disk system, but that is probably how well over 90% of all openSUSE are installed (/home in its own partition on the same disk as / )

TSU

Photorec worked like a miracle, not only found my deleted folder but a bunch of other files deleted some time ago. Did not know I had so much **** laying around.
Malcom: Thanks for that pointer, Photorec will stay in my emergency kit from now on.

I did unmount the affect partition right after my clumsy move onto the delete key; that was key in finding everything in one piece.

Tsu2: Good advice; in the middle of a disarter the last thing you want is to mess things up further. In my case, I had a backup of everything on that partition but one folder. Do not ask me why I left it out.
Unmount and clone the affected partition/drive to work on is highly recommended; now I know what I talking about…what a day!!!

Anyhow, thank you much to all who pitched into this, not only for the technical help but also for making me feel I was not alone with my misery.

Cheers!!!

Remember, a file based backup generally backs up only files and folders that have not been deleted.
If you want to preserve everything in the partition including the files marked deleted, you have to clone the entire partition.

This is also why in various scenarios you want to “zero out” the empty, “unused” space in your file system…

  • When you are dealing with virtual disks, you may want to compact and shrink your disk after deleting a large number of files
  • You may want to migrate or clone your disk or partition, for instance when upgrading your system disk
  • As a security measure, you’re concerned about someone taking possession of your disk and recovering the files

In the above scenarios, you want to “zero out” the empty space, so that there is <nothing> in the empty space.

TSU

I zero out the free space on my root partition for byte-wise perfect partition backups. 6GB of zeros takes about 10 seconds. Makes the xz tarballs smaller. Wear and tear on my ssd though. Just for reference, a 24GB root partition of a Tumbleweed installation compresses down to about 4GB with xz.

Hello! Here I found a video of data recovery under Linux. At this video UFS Explorer Standard Recovery software is used to recover data from the Ext partition. Maybe this program will help you recover data, otherwise the same program can restore data from the Btrfs partition. On the technical specification of the program, I found the entire list of supported file systems, here is the link