Archive

Posts Tagged ‘Ext3 no undelete’

How I lost all of my source files in less than a minute..

October 5, 2009 Leave a comment

This one is actually pretty old, like about two weeks old, I don’t know why I didn’t post it.

So it was a sunny day, about two weeks ago. All day I tried to setup a normal makefile for my project. I wrote and discarded about 5-6 different versions. Finally after about 10-12hours I got one that was pretty good. The problem was that I couldn’t group the object files that was created, in one directory, so all objects was separated over the project directory. A simple command to remove them:
rm `find ./ -name "*.o"`
And thats it, all objects are gone. You can guess the future from this point, but Ill tell it anyway. So it is late, about 1 AM, my makefile is completed, but I need to remove the object that I might left from previous compilations, so I do:
find ./ -name "*.c"
It gives me a listing of all files that it found. Then I do
rm `find ./ -name "*.c"`
For about 20 seconds I watch the output of the command to understand what the hell I did, and when I understood… it was too late.. Here is the comment or IRC:

16:02:06 <skwo> OH F**CK
16:02:14 <skwo> I just wiped half o my os OO
16:02:24 <skwo> is there anyway to restore files that was removed by rm?
16:02:26 <skwo> omg

(Don’t pay attention to the time, the logs are logged in US time I think).

Of course there were no way to restore the files, cause the designers of EXT filesystem, decided to remove the file at all when its deleted… Yes it was embarrassing 😦 Luckily I had a backup that contained about 80% of the lost code. After this day I setup and SVN for this project, and I wont code for more than 10 hours anymore.