From owner-freebsd-fs Tue Oct 30 10: 3:41 2001 Delivered-To: freebsd-fs@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id BEE6237B409 for ; Tue, 30 Oct 2001 10:03:26 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id FAA00020; Wed, 31 Oct 2001 05:03:07 +1100 Date: Wed, 31 Oct 2001 05:02:07 +1100 (EST) From: Bruce Evans X-X-Sender: To: Alexander Leidinger Cc: , Subject: Re: physical block no -> name of file (FFS)? In-Reply-To: <200110301300.f9UD0KD05773@Magelan.Leidinger.net> Message-ID: <20011031044552.U4473-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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