[kwlug-disc] Successfully recovered a deleted file

B.S. bs27975 at yahoo.ca
Tue Jan 20 00:14:26 EST 2015


Not to make you relive this again ... (-:

But short of an accidental 'mv *.mdwn /dev/null' how did you manage to 
lose the file? (I can't see 'ls *.dwn > /dev/null' being intended, for 
swapping in mv with /dev/null appended to be likely.)

Certainly I have run into an accidental alias' schmucking myself, and 
mv'ing a bunch of files to a single one. Each arg piling over top of the 
prior, and not-cat'ed, even.)

Glad you got it back. May it not happen to anyone else. But it will ... 
usually followed by a lot of swearing, seconds later ...

Note to selves: Remember to set that backup location, and preferably to 
another spindle / NOT a ramdisk. (Also keeps the backup file cruft out 
of the current directory.) You may never need it ... but when you do ... 
you REALLY DO!


On 01/16/2015 04:52 AM, Chris Irwin wrote:
> I made a bit of a mistake. I thought I was doing an `ls *.mdwn`, but I
> actually did `mv *.mdwn`, and effectively deleted a file I had been
> working on for a few hours, but which wasn't old enough to yet be in
> git, a snapshot, or a backup.
>
> I got the file back with `grep`, `vim`, and 100% pure luck.
>
> I wrote up a post of how I did it, and why I didn't do the "right"
> things, like umounting the drive:
>
>      https://chrisirwin.ca/posts/recovering-a-deleted-file-on-btrfs/
>
> Also, I mention btrfs since that was what I'm using, but this would
> likely also apply to other filesystems. I think it was mainly vim's
> behaviour that saved me.
>
> Thought it might be of interest to the list.
>





More information about the kwlug-disc mailing list