Ubuntu – Finding files deleted from shared partition

data-recovery

I recently accidentally deleted a file from a shared partition (I have a dual boot system). However, I only find the recycle bin of Windows on the shared partition, but no recycle bin of Ubuntu. In the normal trash folder of Ubuntu there are only the files deleted from the Ubuntu partition, not from the shared one which has the mount point /media/storage.

How can I recover the file that I deleted?

Thanks for your help!!

Output of lsblk:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk 
├─sda1   8:1    0   100M  0 part 
├─sda2   8:2    0  58.5G  0 part /media/lena/AA68798068794BD7
├─sda3   8:3    0 175.8G  0 part /media/storage
├─sda4   8:4    0     1K  0 part 
├─sda5   8:5    0    56G  0 part /
└─sda6   8:6    0   7.7G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom  

Best Answer

Files "deleted" in other partitions should be temporarily be moved in a .Trash-1000 folder within the same partition they were "deleted" from while pending a "definitive deletion"; this is a hidden folder, so try the following:

  1. Open Files
  2. Open the partition in which the file was deleted
  3. Hit Ctrl+h
  4. Open the .Trash-1000 folder and browse its content

The "deleted" file should be somewhere inside this folder.

If it's not, you can try to recover it with testdisk:

  1. Open a Terminal by hitting Ctrl+Alt+t
  2. Install testdisk: sudo apt-get install testdisk
  3. Run testdisk: sudo testdisk
  4. Choose No Log
  5. Select the drive containing the partition from which the file was deleted and choose Proceed
  6. Choose the partition table type
  7. Choose Analyse
  8. Choose Quick Search
  9. Select the partition from which the file was deleted and hit p
  10. Browse both the folder which used to contain the deleted file and the .Trash-1000 folder and see if your file is listed in red; if it is, select it and hit c
  11. Browse to a folder in which you can copy the recovered file and hit C
  12. Quit testdisk

This should recover the deleted file and copy it in the location specified, altough the file might have been overwritten (and be corrupted) since his deletion from the filesystem entries.

Related Question