From owner-freebsd-fs@FreeBSD.ORG Wed Aug 13 10:31:45 2014 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9928AF0 for ; Wed, 13 Aug 2014 10:31:45 +0000 (UTC) Received: from lwfs1-cam.cam.lispworks.com (mail.lispworks.com [46.17.166.21]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1512233 for ; Wed, 13 Aug 2014 10:31:44 +0000 (UTC) Received: from higson.cam.lispworks.com (higson.cam.lispworks.com [192.168.1.7]) by lwfs1-cam.cam.lispworks.com (8.14.5/8.14.5) with ESMTP id s7DAKeNA038933; Wed, 13 Aug 2014 11:20:40 +0100 (BST) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (localhost.localdomain [127.0.0.1]) by higson.cam.lispworks.com (8.14.4) id s7DAKeqG017625; Wed, 13 Aug 2014 11:20:40 +0100 Received: (from martin@localhost) by higson.cam.lispworks.com (8.14.4/8.14.4/Submit) id s7DAKeCl017621; Wed, 13 Aug 2014 11:20:40 +0100 Date: Wed, 13 Aug 2014 11:20:40 +0100 Message-Id: <201408131020.s7DAKeCl017621@higson.cam.lispworks.com> From: Martin Simmons To: Patrick Proniewski In-reply-to: (message from Patrick Proniewski on Tue, 12 Aug 2014 18:27:06 +0200) Subject: Re: zdb -R question References: Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 10:31:45 -0000 >>>>> On Tue, 12 Aug 2014 18:27:06 +0200, Patrick Proniewski said: > > Hello, > > I've a hard drive with corrupt blocks. I would like to know if those blocks belong to a real file. > > /var/log/message reads: > > smartd[1306]: Device: /dev/ada3, 3 Currently unreadable (pending) sectors > > devices ada2 and ada3 are in ZRAID1 mirror. I think you mean just "mirror"? here. ZRAID1 is not a term used by ZFS -- it has RAIDZ1, but that requires at least 3 drives. > zpool scrub won't show any error. If scrub shows no errors then the blocks are not currently used. > smartctl full test find errors: > > SMART Self-test log structure revision number 1 > Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error > ../.. > # 2 Extended offline Completed: read failure 80% 33003 460087328 > ../.. > # 5 Extended offline Completed: read failure 90% 32936 460087313 > > I've made some attempts with zdb -R to read faulted sectors, but I keep receiving errors like these ones: > > Invalid block specifier: gpt/ben: 460087328:512 - offset must be a multiple of sector size > Invalid block specifier: gpt/ben:409600000:512 - size must be a multiple of sector size > > whatever offset and size I try (4096/512), I always receive one of these errors... Any idea? For a start, you probably have partitions on the disk so that LBA (from the start of the disk) will not be the offset into the ZFS vdev. Secondly, the offset passed to zdb -R should be in bytes, whereas the LBA is in sectors. Try using dd on the whole disk, something like dd if=/dev/ada3 of=/dev/null bs=512 count=1 skip=460087328 Use bs=4096 if your drive has 4096 byte sectors. Don't mix up the if= and of= arguments or you may lose data. __Martin