Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Oct 2001 05:02:07 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Alexander Leidinger <Alexander@leidinger.net>
Cc:        <julian@elischer.org>, <fs@FreeBSD.ORG>
Subject:   Re: physical block no -> name of file  (FFS)?
Message-ID:  <20011031044552.U4473-100000@delplex.bde.org>
In-Reply-To: <200110301300.f9UD0KD05773@Magelan.Leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 30 Oct 2001, Alexander Leidinger wrote:

> On 30 Okt, Bruce Evans wrote:
> > Just back up the files and note which ones can't be read.  Better, compare
> > them with a previous backup.
>
> Yes, this solves my problem (now that I know in which partition the bad
> block is).
>
> But doesn't this need more resources than a dedicated program which only
> traverses the metadata? On a busy system it may be worthwile to have
> such a program (and I may be willing to write it).

It is not possible to detect unreadable files by traversing only their
metadata.  Only unreadable metadata may be detected in this way.  Every
block in every file must be read to see if it can be, erm, read.  It
may be possible to find them all using dd on the disk device (with a
block size of 1b so as not to miss any), but if there are a lot of
them this probably won't be much faster than reading the files,
especially if not all the bad blocks are in files, since the time for
retrying the reads will dominate.

> >> But thanks for the hint, I haven't thought at looking into fsck, will do
> >> it later.
> >
> > fsck is not very useful for the original problem of finding files with
> > bad blocks in them, since it only accesses metadata.
>
> And the sequence of blocks which holds the content of a given file
> isn't included in this metadata?

You still have to read them all to see if they are bad.  The filesystem
is likely to be better optimized for doing this than any simple program.

Bruce


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




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