0

Running Ubuntu 20.04.1 LTS, I plugged in a usb flash drive and an external drive via usb.

Using GUI "Files" I created a new directory (let's call it New_Directory for further reference) in the external hard drive.

I then selected another directory in the usb flash drive (this directory contained only one archive), and cut it.

I switched to another window of "Files" where the external hard drive was opened. There I clicked "paste".

The moving process began. It was taking some time. I didn't notice if it finished or not, but at some point in time the external hard drive's status began rapidly changing, as if it was being plugged in and out quickly (which it was not - it sits firmly on a solid ground).

After that the directory I wanted to move disappeared. It is nowhere to be found. It isn't in Trash, hidden files do not display it among them, find -name dir_name returns nothing.

Interestingly, the New_Directory also vanished. I can't find it. Could it be of importance that its name contained ;( at the end? Yeah, irony.

Lessons learned:

  • important files should rather be copied than moved;
  • perhaps copying files to the desktop first is safer than from one external device to another.

Would you please suggest a way to restore this archive?

P. S. It was only later that I noticed "Undo" and "Redo" buttons in GUI "Files". They seem to only keep track of the last operation which unfortunately was overwritten since then. But I know for sure that when I cut and pasted the directory, it was not in the buffer - "paste" option was disabled, as if there was nothing to paste.

  • 1
    cut & paste is the same as move. Moving to a different drive means copy and when finished delete. This is safe, because when the copy is not successful, nothing gets deleted. So it is not clear what is your problem, as I doubt someone here will be able to reproduce. It might be hardware failure. The special chars at the end shouldn't be a problem here. If it was important files, try to use some recovery, e.g. testdisk/ photorec . – pLumo Jul 30 '20 at 09:42
  • Thank you for the response! Since I do not see the directory anywhere, it must be deleted from the usb drive. Therefore, can it be "restored" in any way as if it was simply mistakenly deleted? (The file is absent in Trash unfortunately). I tried ddrescue - to no avail so far, but it may be due to the fact that I don't yet know how to use it properly. I'll try other utilities you suggest too. – Ilya Chernov Jul 30 '20 at 09:45
  • @pLumo thank you so much! Based on your comment I ran testdisk, hoping that the "deleted" directory would still be kept in the usb drive from which I tried to move it. It turned out to be so. While group restoration didn't work, I managed to restore the file individually! (By "group restoration" I mean that I copied a number of files and directories, just out of curiosity - wanted to see what else I had there). – Ilya Chernov Jul 30 '20 at 10:30
  • Glad to hear. You may write an answer to your question with the detailed procedure, that may help others too – pLumo Jul 30 '20 at 10:37
  • Sure thing! Done – Ilya Chernov Jul 31 '20 at 11:45
  • Yes, this answer mentions testdisk too (the tool that helped me recover the file). Thank you @karel. – Ilya Chernov Jul 31 '20 at 12:32
  • Clicked on it, thank you. However, the answer that would've helped me is not marked as the correct one (in fact no one is). – Ilya Chernov Jul 31 '20 at 12:48

1 Answers1

0

Thanks to @pLumo I managed to restore the file in question. Since the file was deleted once it was (apparently successfully?) copied, I used testdisk tool to view the usb drive's contents, where the file was before this unfortunate cut&paste procedure started.

Unlike some others, this utility imitates a GUI, so navigating it was rather easy. Still its best to read documentation first.

When I saw the file I wanted to restore, I also noticed a few other files. Initially I selected them all and used the tool to copy them to another place. It didn't work for the file in question. I proceeded to copy the file alone, and it did work!

Another lesson to base backup strategy on abundance.


What happened to the place to where the file was moved? This mystery will be left aside for a while, until I replace the backups to a safer storage unit.