Page 1 of 1

files recovered by using testdisk locked

Posted: Fri Aug 12, 2016 11:34 am
by electroken
I have now used testdisk to recover some deleted files including videos and pictures from one of my drives where there was a glitch in moving them and they were accidentally lost. I see them on my other drive now where I had testdisk put them while I was using my administer priveleges to do it. Testdisk must be run from the command line as sudo testdisk which I did as drected.

But then the files are now on my other disk and seem to be there correctly but each one of them has a x in the lower right corner of the icon and also a padlock shown too.
Now I am stuck. I cant seem to open the directory as administrator as when I attempt that it the computer seems to do nothing at all and does not open the folder I am telling it to open as administrator.
I did try to see if I could reboot and log in as administrator but I must not be doing something right there either as it never seems to give me that option.

If it frustrating since I used to be able to do this using some programs in windows in the past without nearly all the issues I am having with linux.

I hope there is a way to just unlock these files as a group if I have to do it on the command line as I am leery of it. I cant imagine needing to do it almost 150 times to unlock all those files and change permissions on them so I can actually use them again.

I am admittedly not comfortable nor knowledgeable to be turned loose on the command line. I can only imaging making his a bigger mess than it is.

Please help

Re: files recovered by using testdisk locked

Posted: Fri Aug 12, 2016 1:29 pm
by fungus
When you run TestDisk (probably PhotoRec) as sudo all files it creates will most likely belong to root - you must take ownership of them. If your username is "hugo" and the files are in "/path/to/my/rescued/files" you must open a console, and run the command:

Code: Select all

sudo chown -R hugo:hugo /path/to/my/rescued/files
This will change the ownership of the folder "files" and all of its content -Recursively to you:your_group.

Re: files recovered by using testdisk locked

Posted: Fri Aug 12, 2016 4:17 pm
by electroken
I finally found on line somewhere that to undo the locked read only files I got as a result of testdisk I had to do the following:

I had testdisk put the recovered files in my home directory so I went to the home directory and opened it as terminal.

Next I used the following command in the terminal: sudo chmod 777 * -R

The asterisk causes the command to apply to all folders and files I think. At least that did the trick.

Ken

Re: files recovered by using testdisk locked

Posted: Fri Aug 12, 2016 4:33 pm
by Cosmo.
No doubt, that this "did the trick". But nearly surely it created a new problem: You will most likely not be able to log in at the next try.

To correct this do this in a terminal:

Code: Select all

chmod 600 ~/.dmrc ~/.ICEauhority

Re: files recovered by using testdisk locked

Posted: Fri Aug 12, 2016 8:45 pm
by Mute Ant
Next time...drag-and-drop a copy of the owned-by-root files onto the desktop, where you will own the copies.

If you add yourself to the disk group you can read (and write) drives without needing sudo. That might be just what you want, or an unacceptable hazard...your choice.