1

I tried to transfer ('cut and paste') about 2gb of files from my system (running Linux Mint 15, KDE 4.2) onto my USB stick (8gb capacity). The notifications manager indicated that the copy was complete, so I removed the USB drive and mounted it on my other computer. Then it showed that only one of the files had been written to the USB.

Is there any way for me to recover the missing files?

  • I'd say it's doubtful. – slm Oct 22 '13 at 2:47
  • 1
    If you removed the device before unmounting it properly, chances are there's nothing to recover because not everything was written to it in the first place. – Alexios Oct 22 '13 at 11:29
  • Sure - but what about the files on my computer? Wouldn't those still be recoverable, even after 'deletion' by cutting? – Newb Oct 22 '13 at 20:00
0

mv returns as soon as the files have been moved from the applications' point of view. If any program tries to read the files after mv returns, it will find them on the USB stick and not on the hard disk. However, it is possible that the content of the files and the updated directory on the USB stick are still in the disk buffers and not yet written out to the USB stick.

If you pull out the USB stick without unmounting it first, there is no guarantee that the USB stick has all the data that it's supposed to have, or indeed that it's in a consistent state (it's unlikely, but possible, that old files will be temporarily unreachable).

Always unmount removable drives before disconnecting them.

The sync mount option reduces the window of risk at the expense of making writes slower, but it does not remove the risk. It also kills older USB sticks faster.

The files may or may not still be on your computer. Linux does not make recovering deleted files easy. If this was a lot of small files, forget it. If this was a few big files, especially if the files have a recognizable format (pictures, mp3s, videos, …), you have a chance. Stop writing to the drive immediately: anything you write reduces the chance of recovery. If this is your system drive, download and reboot to a special-purpose distribution. If not, install carving tools with your distribution's package manager. See How to recover data from a bad SD card? for some tool names.

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.