From owner-freebsd-current@FreeBSD.ORG Mon Mar 8 11:21:50 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BB4D1065674 for ; Mon, 8 Mar 2010 11:21:50 +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 BEDFF8FC14 for ; Mon, 8 Mar 2010 11:21:49 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id AC37219E02D; Mon, 8 Mar 2010 12:21:47 +0100 (CET) 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 62B7019E02A; Mon, 8 Mar 2010 12:21:45 +0100 (CET) Message-ID: <4B94DDC8.5080008@quip.cz> Date: Mon, 08 Mar 2010 12:21:44 +0100 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.8) Gecko/20100205 SeaMonkey/2.0.3 MIME-Version: 1.0 To: Eugeny N Dzhurinsky References: <20100308102918.GA5485@localhost> In-Reply-To: <20100308102918.GA5485@localhost> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: A tool for remapping bad sectors in CURRENT? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2010 11:21:50 -0000 Eugeny N Dzhurinsky wrote: > Hello, all! > > Recently I've started to see the following logs in messages: > > Mar 8 12:00:24 localhost smartd[795]: Device: /dev/ad4, 2 Currently unreadable (pending) sectors > Mar 8 12:00:24 localhost smartd[795]: Device: /dev/ad4, 2 Offline uncorrectable sectors > > smartctl did really show that something is wrong with my HDD, but still no > remaps - just read errors. > > SMART Self-test log structure revision number 1 > Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error > # 1 Extended offline Completed: read failure 60% 1198 222342559 > # 2 Extended offline Completed: read failure 60% 1187 222342557 > # 3 Extended offline Completed: read failure 60% 1180 222342559 > # 4 Short offline Completed without error 00% 1178 - > # 5 Extended offline Aborted by host 90% 1178 - > > and > > ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE > ... > Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 > ... > > Now can I find out which file owns the LBAs 222342557 and 222342559 ? How do I > force remapping of these sectors? I assume that I have to write something > directly to the sectors? We have this problem from time to time on bunch of machines. As we are using gmirror, the easiest way is to force re-synchronization (rewrite) of the whole drive. The problem is when there are Pending unreadable sectors on both drives - it ends up with read error and some file(s) are corrupted, but there is no easy way (on FreeBSD) to find what file. I tried it in the past with fsdb / findblk, but it does not work as I expect or I do not fully understand the needed calculations with slices + partitions offsets / LBAs and right meaning of the term "block". It seems there are several meaning in different contexts. It would be nice if somebody with enough FS / GEOM knowledge can write some HowTo or shell script to do the calculations and operations to find file containing bad sector(s) and put it in FAQ, Handbook, or Wiki. Miroslav Lachman