From owner-freebsd-fs@freebsd.org  Tue Jan 16 14:03:20 2018
Return-Path: <owner-freebsd-fs@freebsd.org>
Delivered-To: freebsd-fs@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2448BE7142F
 for <freebsd-fs@mailman.ysv.freebsd.org>; Tue, 16 Jan 2018 14:03:20 +0000 (UTC)
 (envelope-from kwiat@panic.pl)
Received: from mail.panic.pl (mail.panic.pl [188.68.250.13])
 by mx1.freebsd.org (Postfix) with ESMTP id DB07B7AD90
 for <freebsd-fs@freebsd.org>; Tue, 16 Jan 2018 14:03:19 +0000 (UTC)
 (envelope-from kwiat@panic.pl)
Received: from mail.panic.pl (localhost [127.0.0.1])
 by mail.panic.pl (Postfix) with ESMTP id E171F42A9B
 for <freebsd-fs@freebsd.org>; Tue, 16 Jan 2018 14:57:39 +0100 (CET)
X-Virus-Scanned: amavisd-new at panic.pl
Received: from mail.panic.pl ([127.0.0.1])
 by mail.panic.pl (mail.panic.pl [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id ip2HNSIVWIpk for <freebsd-fs@freebsd.org>;
 Tue, 16 Jan 2018 14:57:39 +0100 (CET)
Received: from [192.168.0.28] (188.146.35.168.nat.umts.dynamic.t-mobile.pl
 [188.146.35.168])
 by mail.panic.pl (Postfix) with ESMTPSA id E07E142A98
 for <freebsd-fs@freebsd.org>; Tue, 16 Jan 2018 14:57:38 +0100 (CET)
Subject: Re: Academic exercise: trying to recover a corrupted pool
To: freebsd-fs@freebsd.org
References: <F6B823C4-313E-4AF2-B1F6-6AFE8E17458B@sarenet.es>
From: Mateusz Kwiatkowski <kwiat@panic.pl>
Message-ID: <19f67e4f-7df8-6184-e396-aa8cde44eb83@panic.pl>
Date: Tue, 16 Jan 2018 14:57:38 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.5.2
MIME-Version: 1.0
In-Reply-To: <F6B823C4-313E-4AF2-B1F6-6AFE8E17458B@sarenet.es>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-BeenThere: freebsd-fs@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: Filesystems <freebsd-fs.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-fs>,
 <mailto:freebsd-fs-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-fs/>
List-Post: <mailto:freebsd-fs@freebsd.org>
List-Help: <mailto:freebsd-fs-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-fs>,
 <mailto:freebsd-fs-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Jan 2018 14:03:20 -0000

On 01/08/2018 03:25 PM, Borja Marcos wrote:
> 
> Hi,
> 
> ONLY AS AN ACADEMIC EXERCISE, WARNING :)
> 
> I have a broken ZFS pool and I’m wondering wether it should be readable. The pool was made with four
> apparently troublesome OCZ SSD drives pulled from other systems. They are connected to a LSI2008 adapter.
> 
> The pool was created as a raidz2, so it’s supposed to survive the loss of two drives. It has lost two of them
> and I am unable to import it.
> 
> I have lost no useful data, I was using it just for testing. Now it has become an interesting study subject though :)
> 
> Any ideas? I have tried to recover even doing the “radical thing” (zdb -Z -AAA -e -p /dev poolname). No success.
> 
> Again, I am just curious.
> 
> 
> Thanks!

Few years ago I made similar exercise with pool broken by some ZFS on 
Linux bug. After many unsuccessful attempts to import the pool I came up 
with an idea to read data without importing the pool.
Here's the script: https://gitlab.com/kwiat/zfs-recovery

The code is in no way effective nor beautiful, but I learned a lot about 
ZFS when I was working on it. :-)

--
Regards,
Mateusz Kwiatkowski