Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I had a file on a USB stick, and I was editing it but then I saved it and pulled out the USB. Later when I plugged it back in, the file had a size of 0 as well as the backup made by kwrite(I a running linux). What happened? And how can I recover it?

share|improve this question

migrated from stackoverflow.com Apr 4 '13 at 2:24

This question came from our site for professional and enthusiast programmers.

    
You pulled it out w/o unmount/eject? –  tink Apr 4 '13 at 2:08

2 Answers 2

Re the what happened: you were hit by pebcac. With multi-user multi-tasking OSes it's never safe to just pull a USB storage device after a "write/save" activity because modern OSes cache writes, too, unless you specifically disable it. Even WHEN you disable it it's still a potentially hazardous thing to do, depending on the size of your write, and the write speed.

Re recovery: I'm afraid there is none in your specific case. You may get lucky with some forensic tool, e.g. photorec

share|improve this answer

in any linux distribution you must always "eject" the device before you pull it out by right clicking on the device and find in menu. always wait until any flashing indicators on flash dirve are finished and even then i like to wait about 10-15 seconds. I first encountered this on ubuntu 7.10 nothings changed since.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.