files recovered by using testdisk locked

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
electroken

files recovered by using testdisk locked

Post 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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
fungus
Level 4
Level 4
Posts: 386
Joined: Mon Sep 07, 2015 6:09 am

Re: files recovered by using testdisk locked

Post 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.
Linux Mint 17.3 64bit KDE @ Asus B150M-A, i3 6100, Crucial 16GB DDR4, Crucial BX100
One bit says: YES, the other answers: NO.. Guess who's he and who's she..! ;)
electroken

Re: files recovered by using testdisk locked

Post 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
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: files recovered by using testdisk locked

Post 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
Mute Ant

Re: files recovered by using testdisk locked

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

Return to “Software & Applications”