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:

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  
  • The shared one is NTFS? How is it mounted? (provide the /etc/fstab line please by editing it into your question). "Where can I find the file that I deleted?" Most likely nowhere; you might want to look into "testdisk"; it is a tool to recover deleted files. – Rinzwind Mar 26 '15 at 11:16
  • I don't know, since I didn't set up the laptop and I'm not very experienced with laptops and Ubuntu, I'm sorry. It's called /media/storage, if that helps... Okay, I installed testdisk, but it has no access to the shared partition, just to the one where Ubuntu is installed on. – Thomas Mar 26 '15 at 11:29
  • Please post the output of lsblk with a note, which line refers to the file system in question (look at the right-most column for the mount point path). – David Foerster Mar 26 '15 at 11:46

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.

  • Thanks, that already helps me a lot! However, the subfolders in this .Trash-1000 folder are all empty. – Thomas Mar 26 '15 at 13:03
  • @LCF For some reason the file has been "deleted" right after then. Try testdisk then. I can write an answer explaining how to use it if you need it, but it should be pretty straightforward – kos Mar 26 '15 at 13:11
  • @LCF I did that anyway, give it a try – kos Mar 26 '15 at 13:46
  • Thanks. I already tried testdisk, but it has no access to the shared partition, just to the one where Ubuntu is installed on. – Thomas Mar 26 '15 at 13:51
  • @LCF If your partition isn't listed, after step 8 try to hit Enter and choose Deeper Search instead – kos Mar 26 '15 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.