From owner-freebsd-fs@FreeBSD.ORG Mon Jul 12 07:03:12 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C273106566B for ; Mon, 12 Jul 2010 07:03:12 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id DF9FC8FC1E for ; Mon, 12 Jul 2010 07:03:11 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 5828319E02D; Mon, 12 Jul 2010 09:03:09 +0200 (CEST) Received: from [192.168.1.2] (r5bb235.net.upc.cz [86.49.61.235]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 0059119E027; Mon, 12 Jul 2010 09:03:06 +0200 (CEST) Message-ID: <4C3ABE2A.50802@quip.cz> Date: Mon, 12 Jul 2010 09:03:06 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.10) Gecko/20100504 SeaMonkey/2.0.5 MIME-Version: 1.0 To: Dmitry Lunts References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: fsdb&smartctl&/var/log/messages X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2010 07:03:12 -0000 Dmitry Lunts wrote: > Hello,all! > The question is as follows. > 1).When I try to upgrade some port or merely execute the command pkgdb -uF > I get the error: > Input/output error - /var/db/pkg/kdeutils-3.5.10_5/+CONTENTS > > 2)$sudo cat /var/log/messages|grep DMA|tail -2 > gives: > Jul 12 03:07:06 dim007 kernel: ad6: FAILURE - READ_DMA > status=51 error=40 LBA=4007967 > Jul 12 03:07:09 dim007 kernel: ad6: FAILURE - READ_DMA > status=51 error=40 LBA=4007967 > > 3)From the output of > $cat /etc/fstab and > $sudo bsdlabel ad6s1: > # size offset fstype [fsize bsize bps/cpg] > a: 1048576 0 4.2BSD 2048 16384 8 > b: 1048576 1048576 swap > c: 100663227 0 unused 0 0 # "raw" part, don't > edit > d: 2097152 2097152 4.2BSD 2048 16384 28552 > e: 655360 4194304 4.2BSD 2048 16384 40968 > f: 37748736 4849664 4.2BSD 2048 16384 28552 > g: 58064827 42598400 4.2BSD 2048 16384 28552 > I can conclude that LBA=4007967 falls into /dev/ad6s1d partition mounted as > /var > > Next: > 4) $sudo fsdb -r /dev/ad6s1d > ** /dev/ad6s1d (NO WRITE) > Examining file system `/dev/ad6s1d' > Last Mounted on /var > current inode: directory > I=2 MODE=40755 SIZE=512 > BTIME=Jan 1 15:07:34 2009 [0 nsec] > MTIME=Jul 12 03:03:19 2010 [0 nsec] > CTIME=Jul 12 03:03:19 2010 [0 nsec] > ATIME=Jul 10 01:09:22 2010 [0 nsec] > OWNER=root GRP=wheel LINKCNT=27 FLAGS=0 BLKCNT=4 GEN=5e655284 > > Offset of bad LBA sector within /dev/ad6s1d (i.e., /var) partition is: > (bad LBA sector-63-offset of /dev/ad6s1d=4007967-63-2097152=1910752 (see the > output of bsdlabel above) > > 5) Searching for inode: > fsdb (inum: 2)>findblk 1910752 > 1910752: data block of inode 117934 > > 6)Searching for file: > $sudo find /var -inum 117934 > /var/db/pkg/kdeutils-3.5.10_5/+CONTENTS > which exactly corresponds to error message from pkgdb -uF (see item 1) > above) [...] > 10) And what's more: > offset of LBA_of_first_error within /dev/ad6s1d is > 4007996-63-2097152=1910781 > fsdb->findblk returns nothing: > fsdb (inum: 2)> findblk 1910781 > fsdb (inum: 2)> > > So, the puzzle is: > from one hand, pkgdb -uF, /var/log/messages, fsdb point to the same bad > sector (4007967) and filename > this sector belongs to > (and even cat /var/db/pkg/kdeutils-3.5.10_5/+CONTENTS returns Input/Output > error), > but low level reading of bad sector returns without a sign of error. >> From the other hand, smartctl long test performed immediately after low > level read test with dd > gives quite another number of bad sector (4007996) which in turn doesn't > belong to any file. > > And what makes me completely lost is that > the tests in items 1)-10) were repeated two times and gave the same > results! > So where are 29 (4007996-4007967) sectors lost? > Could anyone give me a hint where I'm wrong? I had similar problem in the past. You can find more about it here http://lists.freebsd.org/pipermail/freebsd-current/2010-March/015987.html Miroslav Lachman