TransWikia.com

TestDisk always return corrupted files

Unix & Linux Asked by user408830 on November 23, 2021

I accidentally remove all of my files (Python Files) in Visual Studio Code, and I tried to use testdisk tool to recover them, I checked what filesystem I’m using, and it is /dev/sda5 and the type is ext4

This is the steps I did to recover my files:

$ sudo testdisk /dev/sda5

I selected None as the partitioned media. And then, I didn’t see the undelete option, so I chose the List option.
And finally I moved to the path that my files got deleted, and I copy them all to my desktop, but when I open a file, no matter which file, the data is just random bytes. The data in the file is corrupted.

If I did something wrong, please guide me step by step how to do that, I had a lot of important projects ):


I am using Ubuntu

One Answer

I fear it is already too late by now.

If you keep using the device, or possibly even if you just keep it mounted. It is almost guaranteed that all deleted files will eventually become overwritten and thus practically impossible to recover.

What you should have done

  1. Immediately umount the device.
  2. Make a complete sector-by-sector image clone of the device.
  3. Do recovery-work on copies of the image only.
  4. Do not mount the device until you got the files back from your image-file.

Also. What kind of physical storage device used will affect procedures and chance of success.

Answered by svin83 on November 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP