From owner-freebsd-current@FreeBSD.ORG Sat Mar 13 20:45: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 EC48C1065678 for ; Sat, 13 Mar 2010 20:45: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 AA1D88FC2F for ; Sat, 13 Mar 2010 20:45:15 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 4004A19E02A; Sat, 13 Mar 2010 21:45:14 +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 DCF7B19E023; Sat, 13 Mar 2010 21:45:11 +0100 (CET) Message-ID: <4B9BF957.4060507@quip.cz> Date: Sat, 13 Mar 2010 21:45:11 +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: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <20100308102918.GA5485@localhost> <4B94DDC8.5080008@quip.cz> <20100308115052.GA31896@office.redwerk.com> <4B94FBA6.5090107@quip.cz> <861vfq995i.fsf@ds4.des.no> In-Reply-To: <861vfq995i.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: Sat, 13 Mar 2010 20:45:16 -0000 Dag-Erling Smørgrav wrote: > Miroslav Lachman<000.fbsd@quip.cz> writes: >> Yes, rewriting by dd or any other way works for reallocating or >> clearing pending sectors counter, but in server environment > > In a server environment, you'd be a fool not to have some sort of > redundancy set up. I am using gmirror on low-end servers, so rewriting some sectors on one disk drive is useless and in this case I prefer resync of the whole gmirror (but it is log run - about 10 hours on busy server) >> 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. > > How is that different from *not* rewriting the sector? If there's a bad > sector somewhere in your data, your database is still going to crash. It is not about "different", it is about "I need to know the affected file" to know what actions should be taken. If it is some logfile, I can delete it and then rewrite the sector. If it is some "normal" unchanged file, I can restore it from backup, if it is database file, I must take some special action. For example, stop DB engine, try to repair/fix the DB file, dump & restore etc. So the first step is to find "what file is affected", then take some action AND rewrite the sector by dd to reallocate the sector. (or replace the drive) So... can somebody with enough knowledge write some docs / script how to find the affected file based on LBA read error from messages / SMART log? Miroslav Lachman