From owner-freebsd-current@FreeBSD.ORG Mon Mar 8 13:29:15 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 675CE106564A for ; Mon, 8 Mar 2010 13:29:15 +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 23AA18FC12 for ; Mon, 8 Mar 2010 13:29:14 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 8FDC719E02A for ; Mon, 8 Mar 2010 14:29:13 +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 4746519E027 for ; Mon, 8 Mar 2010 14:29:11 +0100 (CET) Message-ID: <4B94FBA6.5090107@quip.cz> Date: Mon, 08 Mar 2010 14:29:10 +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: freebsd-current@freebsd.org References: <20100308102918.GA5485@localhost> <4B94DDC8.5080008@quip.cz> <20100308115052.GA31896@office.redwerk.com> In-Reply-To: <20100308115052.GA31896@office.redwerk.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit 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 13:29:15 -0000 Eugene Dzhurinsky wrote: > On Mon, Mar 08, 2010 at 12:21:44PM +0100, Miroslav Lachman wrote: >> Eugeny N Dzhurinsky wrote: >> 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, thank you for the suggestion - but I am not using gmirror, that HDD > is the one on my laptop. However suggestions about using dd to write something > into bad block to force IDE controller do it's service stuff about remapping > seems did the trick. And I was able to not calculate LBA but use it as block > offset, which seemed to be correct way :) Yes, rewriting by dd or any other way works for reallocating or clearing pending sectors counter, but in server environment I need to know the affected file, as it can be for example database file and then it is a big problem! Rewriting the sector inside InnoDB ib_data file can cause DB crash, data loss etc. Miroslav Lachman