Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Feb 2005 05:34:48 +0000
From:      "John" <lists@reiteration.net>
To:        freebsd-questions@FreeBSD.org
Subject:   Re: I killed my system with grep
Message-ID:  <20050226052037.M6206@reiteration.net>
In-Reply-To: <003801c51b2b$1deecc60$04cf589d@simula.eis.uva.es>
References:  <003801c51b2b$1deecc60$04cf589d@simula.eis.uva.es>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 25 Feb 2005 12:14:04 +0100, Ramiro Aceves wrote
> Hello FreeBSD friends:
> 
> I am running a FreeBSD 5.3 system with 64MB RAM and 150 MB swap.
> 
> Yesterday I entered the command:
> 
> # grep -R something /
> 
> and after a while, my system did not respond. I do not remember the exact
> messages as I am on a winbugs at the University. The error was about
> swapping. I could switch among terminals but the system was dead. I needed
> to reboot.
> 
> I rebooted and tried again watching "top" output and I could see as swap
> usage was incresing very quickly until it ran out of swap space and 
> the swap pager failed.
> 
> Was my sytem dead? or, is it possible to recover from that state without
> rebooting? How is it possible that a simple command like this could
> auto-kill the machine?
> 
> What is the recomended fix for this?:
> 
> a- Asigning more swap.
> b- Not executing that command anymore.

I had a very similar problem. I fixed it by reading up on auxillary swapfile.
I set one of those up as indicated, at about 2.5x RAM (750MB, roughly) and the
problem went away after I edited /etc/fstab and commented out the old swap
entry, then rebooted.

The problem was caused by the hard drive having failing blocks where the swap
partition resides. I got a few errors in /var/log/messages where the swap
daemon couldnt zero pages or inodes or whatever. If the swapper cant liberate
old pages then swap will fill up. My machine uses a lot of perl, and
openwebmail makes it swap under load. 

It seems that the bad blocks are only on the old swap so hopefully the hard
drive still has some life in it yet. 
--
lists@reiteration.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050226052037.M6206>