From owner-freebsd-current@FreeBSD.ORG Sat Mar 13 21:24:51 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 50A25106564A for ; Sat, 13 Mar 2010 21:24:51 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0CE8C8FC14 for ; Sat, 13 Mar 2010 21:24:50 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D1EF61FFC22; Sat, 13 Mar 2010 21:24:49 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 8F256844A7; Sat, 13 Mar 2010 22:24:49 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Miroslav Lachman <000.fbsd@quip.cz> References: <20100308102918.GA5485@localhost> <4B94DDC8.5080008@quip.cz> <20100308115052.GA31896@office.redwerk.com> <4B94FBA6.5090107@quip.cz> <861vfq995i.fsf@ds4.des.no> <4B9BF957.4060507@quip.cz> Date: Sat, 13 Mar 2010 22:24:49 +0100 In-Reply-To: <4B9BF957.4060507@quip.cz> (Miroslav Lachman's message of "Sat, 13 Mar 2010 21:45:11 +0100") Message-ID: <86eijn3of2.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 21:24:51 -0000 Miroslav Lachman <000.fbsd@quip.cz> writes: > 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? ZFS will tell you straight away, but I guess if you used ZFS, you wouldn't be asking :) For FFS, you can unmount the file system (boot from a CD or memory stick or whatever if that file system is / or /usr), run fsdb on the failing disk, use findblk to look up the inode number for the file that contains the bad sector. Note that you have to convert the LBA to an offset relative to the start of the partition. Unfortunately, you can't easily go from inode to file name; you have to mount the file system and use something like find -inum. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no