[SOLVED] Recover accidentally deleted files?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Pjotr
Level 24
Level 24
Posts: 20133
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

[SOLVED] Recover accidentally deleted files?

Post by Pjotr »

Today, I accidentally deleted a lot of files from an EXT4 partition. It was an ordinary "delete" within the file manager, after which I emptied the trash bin. So thankfully no formatting and such.

Now I want those files back.... :P

I already searched a bit for solutions and tried testdisk, but no success so far. Who has a good tip for me?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Habitual

Re: Recover accidentally deleted files?

Post by Habitual »

PhotoRec ?
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Recover accidentally deleted files?

Post by rene »

You could also try "extundelete", itself available through apt-get and its documentation through after installation "$ man extundelete" and/or http://extundelete.sourceforge.net/.

I seem to recall it having been kind to me on occasion but also note http://batleth.sapienti-sat.org/project ... l#undelete. That is, basically you're buggered.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Recover accidentally deleted files?

Post by Cosmo. »

Additional problem might be, that the Trash bin can contain several files with the same file name. As this is not physically possible inside of one folder, the files get renamed and the real file name gets stored (with some other information) inside of Trash/info. This means, that you have to look for files with a slightly different name, than they had originally.
User avatar
Pjotr
Level 24
Level 24
Posts: 20133
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: [SOLVED] Recover accidentally deleted files?

Post by Pjotr »

Thanks for your answers! With Photorec I seem to be able to undo a lot of damage. :)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
kukamuumuka

Re: [SOLVED] Recover accidentally deleted files?

Post by kukamuumuka »

R-Linux is easy to use and it finds also deleted files.
show deleted.jpg
Habitual

Re: [SOLVED] Recover accidentally deleted files?

Post by Habitual »

administrollaattori wrote:R-Linux
I forgot about this gem!
electroken

Re: [SOLVED] Recover accidentally deleted files?

Post by electroken »

I used testdisk to try to recover some files lost while copying them. I was copying folders each containing a movie and its description as a txt file usually. I was copying them into another directory on the same disk. Something went wrong and I suddenly had lost almost all the content of the larger directory and I had deleted the other directories using shift del.

I made the recovery (as much as I could have hoped for) but the files (movies and all the txt files or any other recovered files were all marked with an x in the upper right hand corner and also most had a padlock image on them.

Of course I knew I had to run testdisk as sudo, but I was now faced with how to deal with the files it copied to another drive and how to unprotect them or be able to read them or use them in any way.

How do I do that? I seem to have most I lost but see no way to use the files it recovered. I remember using a windows recover program many years ago that didnt have such a problem. It ran from the gui and not the command line. Seems to me this should not amount to a big deal to recover these files as it was not a result of a partitioning error of some kind of formatting issue. The drive is good and checks ok as far as I would risk checking it.

I have not copied to the drive with the problem. I have looked at directories and tried to open some files but no manipulation on the subject disk.

My biggest issue is to be able to use the files which were recovered so far. I am also going to try to use R-Linux
kukamuumuka

Re: [SOLVED] Recover accidentally deleted files?

Post by kukamuumuka »

electroken wrote:but I was now faced with how to deal with the files it copied to another drive and how to unprotect them or be able to read them or use them in any way.
You need to take the ownership the files if you rescued to the linux filesystem.

Code: Select all

sudo chown yourself -R /path/files
sudo chmod 770 -R /path/files
electroken

Re: [SOLVED] Recover accidentally deleted files?

Post by electroken »

Yes I was able to make this work. I went into the directory where all the files were now located and ran the commands from there and it was all good.
Thank you.
Locked

Return to “Software & Applications”