

Once the files are successfully restored and verified, they can be moved back to where they belong and have their ownership restored as well. For this reason, I like to start in a directory like /home/recovery. When you recover deleted files with testdisk, you’re going to end up with the files being restored within the directory form which you started the tool and the files are going to belong to root.

If you don’t have sudo access, you’ll get kicked out early in the process, and your logfile, if you chose to create one, will end up with a message like this in it: TestDisk exited normally. Recovering filesįirst of all, you have to be logged in as root or have sudo access to use testdisk. Interestingly, it’s not just a Linux tool but is also available for MacOS, Solaris and Windows as well.ĭocumentation is available at. Install testdisk with commands like apt install testdisk or yum install testdisk.
