drawkcaB | Backward Compatible logo

rants and tips about software

Watch your root partition

Q: What’s the worst thing that could happen to you on Linux?
A: I don’t know, but not having any more disk space on root partition is disasterous.

It happened to me once again. This time, it looks like I only lost my /etc/hosts file. I was just about to edit it, and tried first with vi. First I mistyped the filename:

milanb@asus:~/devel/svn/ibpp-current$ su
root@asus:/home/milanb/devel/svn/ibpp-current# vi /etc/host
blkwrite failed

Still, not thinking about this strange error message, I tried again:

root@asus:/home/milanb/devel/svn/ibpp-current# vi /etc/hosts
skipping 1 old session file
blkopen’s read failed

Ok, I tought to myself, something’s the matter with vi. Lets use the second option, mcedit (part of Midnight Commander). What a horrible mistake that was:

root@asus:/etc# mcedit hosts

It opened the file properly. I made the changes and pressed F2 to save. It reported some error that it cannot save it. Ok, nevermind, I exited the editor and to my big surprise: file is truncated!

root@asus:/etc# ls -l hosts
-rw-r—r—  1 root root 0 2006-07-26 22:34 hosts
root@asus:/etc# cat hosts
root@asus:/etc#

Aaaargh. Now I have to try to remember what was there (I don’t backup each and every file on each and every machine I have).

P.S. The screenshot: before posting to blogger I usually write the text in editor, especially when system seems unstable (I was still unaware that the root partition is full). KWrite was nice to let me know what is happening. I guess sometimes I’m too lazy to think, and the good thing is that there are programs like KWrite that think for us :)

Milan Babuškov, 2006-07-26
Copyright © Milan Babuškov 2006-2024