[SOLVED] Recover accidentally deleted files?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Pjotr
Level 22
Level 22
Posts: 15878
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 Pjotr on Fri Jun 10, 2016 10:01 am, edited 1 time in total.
Tip: 10 things to do after installing Linux Mint 20 Ulyana
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Habitual
Level 13
Level 13
Posts: 4863
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Recover accidentally deleted files?

Post by Habitual »

PhotoRec ?
rene
Level 16
Level 16
Posts: 6693
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 23
Level 23
Posts: 17817
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 22
Level 22
Posts: 15878
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 20 Ulyana
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
kukamuumuka
Level 16
Level 16
Posts: 6697
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

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
Level 13
Level 13
Posts: 4863
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: [SOLVED] Recover accidentally deleted files?

Post by Habitual »

administrollaattori wrote:R-Linux
I forgot about this gem!
electroken
Level 1
Level 1
Posts: 21
Joined: Sat Feb 09, 2013 8:57 pm
Location: Minnesota
Contact:

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
User avatar
kukamuumuka
Level 16
Level 16
Posts: 6697
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

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
Level 1
Level 1
Posts: 21
Joined: Sat Feb 09, 2013 8:57 pm
Location: Minnesota
Contact:

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.
Post Reply

Return to “Software & Applications”