Recently my wife had a crisis – she deleted a huge amount of files in a directory all in one go, worse still, she had committed the fatal no-no of saving and working on these documents from a USB flash drive.
For anyone who is doing this – STOP IT! NOW! Flash memory has a limited lifespan, and if you don’t use up the whole memory block each time the parts you do use will wear faster*. What this means is you’re eventually going to lose those files if you’re relying on it effectively as a mobile office! That is of course, assuming you don’t lose your USB memory stick on the bus or the tube on the way to work…
Bottom line USB memory sticks are really for moving files around, not permanent storage, and it’s even worse to not make backups!
Back on topic. My wife was in despair, she thought these files were lost. Now anyone who uses Linux extensively knows that Linux creates a .Trash file which stores all deletions till you come to unmount. Not so on Windows – no Windows has it’s own bizarre rules for external memory depending on size. In the case of flash drives, there is pretty much zero chance of restoring from the Recycle Bin.
But all is still not lost! When she called me I was careful to instruct my wife not to touch anything on the USB drive. That means no saving, modifying or adding new files.
We then took the memory drive home and I plugged it into my trusty Ubuntified Sammy n210. I downloaded a package called Testdisk, which comes with a handy utility called Photorec.
For those lonely Windows users, download an Ubuntu live CD, then run Software Centre and install Testdisk and go from there.
Procedures for doing a recovery of files with Photorec can be found at Ubuntu’s Community Documentation portal.
It’s run from the command line but then there’s a simple intuitive GUI interface that gets you to where you need. Just select the USB device, the directory you want to save to and a few clicks later you can restore pretty much everything on the disk.
A word of warning though, Photorec spits out everything with a generic indexed name. The file extensions are there, but it’s a case of opening them up to discover what is inside and renaming those files. A bit laborious but if the documents are that important – worth it.
And once again – BACKUP YOUR FILES!
*I’m not talking about netbook flash hard-drives of course, they have different technology that evens the wear.