Date: Fri, 16 May 2003 09:27:47 -0500 (CDT) From: "Pranav A. Desai" <pdesai1@cs.uh.edu> To: Andy Farkas <andyf@speednet.com.au> Cc: questions@freebsd.org Subject: Re: How to detect hard disk failure ? Message-ID: <Pine.GSO.4.33.0305160917240.18829-100000@themis.cs.uh.edu> In-Reply-To: <20030516092757.A77647-100000@hewey.af.speednet.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi!
We deal with proxy caches and in my experience when there is a disk
failure the system becomes dead in a few seconds because of the heavy disk
usage. So we probably wont be able to do an entire disk scan (36G or
more).
I looked at some libdisk functions (Open_Disk() etc.) and they do seem to
open and write to disks, which will indicate whether a disk is usable or
not. We need to do it as a periodic task, so I am not sure if this will
affect the performance or whether it will even work.
The other thing that I thought of doing is to capture /var/log/messages
for any errors regarding disks. But I have two problems with that.
1) I dont know how to do tail -f in shell script.
2) I am not sure if messages gives all kinds of disk errors.
any thoughts...
thanks
-pranav
*******************************************************************
Pranav A. Desai
On Fri, 16 May 2003, Andy Farkas wrote:
> On 15 May 2003, Lowell Gilbert wrote:
>
> > > Is there a way to detect hard disk failures using either a shell script
> > > or C program ? So that I can take appropriate action in case of a hard
> > > disk failure.
> >
> > You can keep watch the logs for errors accessing the disks...
>
> You can do a "dd if=/dev/ad0 of=/dev/null bs=64k" to read the entire disk
> surface - if there are bad blocks, read errors will show up on the
> console.
>
> --
>
> :{ andyf@speednet.com.au
>
> Andy Farkas
> System Administrator
> Speednet Communications
> http://www.speednet.com.au/
>
>
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.33.0305160917240.18829-100000>
