| IceDragon ( @ 2007-10-09 21:06:00 |
| Current location: | AirForce Base 6 |
| Current mood: | |
| Current music: | Daft Punk - Discovery |
| Entry tags: | diary, linux |
Things you should never type into the terminal
Yesterday night I was doing my holy task of spreading the word of Linux among the common folk still unaware of it. This time it was one of my friends that left the army already and came back here for a couple of days. He seemed fascinated about the idea of free software and the entire operating system with what it is capable of, so I've spent the entire evening showing him around - what's where and how both Ubuntu and Kubuntu look like on the 7.10beta Live CDs.
Everything went fine until I've got excited enough to show him that only root can mess up the entire system, so I showed him how a user has read/exec-only access by trying to delete a file, then proceeded to do the forbidden as root: I typed rm -rf * from within the root directory. It seemed to be a pretty harmless trick, considering that it all was in the LiveCD which was on a temporary filesystem, so I typed that and we started to watch the process - how programs stop launching, how the wallpaper disappears and how disastrous this procedure can be if you still have your external media drive mounted!
I realized it too late - the data LED lit up on the media drive and it took it a couple of seconds to wipe my 35GB collection of music and the rest of the media along with it - the XFS filesystem that the media drive used has proven how fast and effective it can be at such a task - now if it could only undelete files... But alas, I've made a mistake, I've started showing off and the effectiveness of my own systems has taken down gigabytes of data in a matter of seconds! Since the filesystem doesn't support undeletion, I've decided to accept the loss of my media and start from scratch rather than digging mp3 parts from within the hard drive - it really doesn't worth the hassle, at least for me...
To look at the event from an optimistic point of view, I now have a lot of free space for more recent (and possibly better) music and data - that "unforeseen cleanup" is something I might've needed since knowing us - we tend to grab lots of music, then istead of cleaning up the songs we don't listen to, we stockpile them on the drive and keep on adding to it on a daily basis until the space runs out. When that happens, we obviously buy a bigger drive instead of freeing some space - it's easier! Of course it's a pity that some of the movies are gone (Resident Evil for instance), but it's not like I can't find them again anywhere. Looks like this weekend will be a weekend of rebirth - rebirth of my media collections!
The morals of today's story: Never type rm -rf /* on the terminal - even if it's [supposedly] controlled and it's fun to see what happens, the Murphy's law can fire up at any moment and your critical data may become lost. I could've had my entire laptop wiped clean, too, should I have mounted it, but I was very lucky there. I normally don't do "redundant" things like these, but sometimes you've got to try something like that for the sake of curiosity of something, no?.. :P