Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Oct 1998 14:41:42 -0400 (EDT)
From:      Robert Watson <robert@cyrus.watson.org>
To:        questions@FreeBSD.ORG
Subject:   Finding a file with a specific block
Message-ID:  <Pine.BSF.3.96.981023143615.10799A-100000@fledge.watson.org>

next in thread | raw e-mail | index | archive | help

Questions Folks,

I have a remote server running 2.2-stable from a month or so ago.  It
has a number of bad sectors on an old IDE hard disk in it, and I had
thought I had gotten them all with files in /usr/BAD.

thithle:/usr/BAD# ls
./      663927  665225  665451  665718  666121  666347  666853
../     664149  665227  665673  665897  666123  666569  666855
663925  664151  665449  665675  665899  666345  666571

Recently I got the following log message while attempting to make
installworld remotely:

Oct 23 14:31:34 thithle /kernel: wd0s1f: hard error reading fsbn 665227 of
665220-665227 (wd0s1 bn 1054347; cn 1045 tn 15 sn 42)wd0: status
59<rdy,seekdone,drq,err> error 40<uncorr>
Oct 23 14:31:35 thithle /kernel: spec_getpages: I/O read error
Oct 23 14:31:35 thithle /kernel: vm_fault: pager input (probably hardware)
error, PID 8527 failure
Oct 23 14:31:35 thithle /kernel: pid 8527 (install), uid 0: exited on
signal 11 (core dumped)

Fortunately this was only on installing an include file, so the system is
still fine.  However, it appears that this is a block number that should
already be covered by a bad sector file -- why am I running into this?
Two possibilities come to mind -- first, that a directory or file point to
that block as well as the bad block file (and that for some reason fsck
hasn't seen this -- perhaps because it has been booting clean for
months?).  Second, that my bad block file is not actually covering the
right block, despite the name.  Because the machine is remotely managed,
recovering from this is a sensitive operation -- I need to do it without
console access, so have to be careful not to get a dirty file system that
requires local attention to fix -- similarly, I need to avoid a screwed up
world.

This machine is actually just a test machine to install worlds on remotely
before applying the world to the real production machines.

Is there any way I can list all files that reference a particular block on
a device?  Find appears not to have an option to do that.  Is there any
way to list the blocks used by a file (this way I could verify the bad
block file, and/or use this with a recursive find to discover any other
files using the block).

Thanks in advance for any help rendered,


  Robert N Watson 

Carnegie Mellon University            http://www.cmu.edu/
TIS Labs at Network Associates, Inc.  http://www.tis.com/
SafePort Network Services             http://www.safeport.com/
robert@fledge.watson.org              http://www.watson.org/~robert/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.981023143615.10799A-100000>