From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 14 11:46:15 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40A7C17C for ; Sun, 14 Jul 2013 11:46:15 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm2-vm1.bullet.mail.ird.yahoo.com (nm2-vm1.bullet.mail.ird.yahoo.com [77.238.189.200]) by mx1.freebsd.org (Postfix) with SMTP id 74368E07 for ; Sun, 14 Jul 2013 11:46:13 +0000 (UTC) Received: from [77.238.189.56] by nm2.bullet.mail.ird.yahoo.com with NNFMP; 14 Jul 2013 11:46:12 -0000 Received: from [46.228.39.80] by tm9.bullet.mail.ird.yahoo.com with NNFMP; 14 Jul 2013 11:46:12 -0000 Received: from [127.0.0.1] by smtp117.mail.ir2.yahoo.com with NNFMP; 14 Jul 2013 11:46:12 -0000 X-Yahoo-Newman-Id: 715895.7846.bm@smtp117.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZzF43IYVM1mXYdFWXBVNfhujYWFkG6.2kP06V3PHHzpXN4s 3td09ckvDbdBCbTyXmYyiFTg.PU7ktz.zvxJLOXftfJBhX1hK3p8oquVuVVk OH9I9oAGae02jTZzpLwwvWudaMPuiOwdhKCzZ2zZinZ_npm_yS0aBvwi1e5h 75kTYBBfG72XeRTnH0GlTgsAF.P_oa7k9Jj_TXXTaoRh0s6O9jgT0JsJGXH. fIydt8.ToLyyg3I49FrlAQ1tfmMEdOTqDBeZe6dq9_Utr566uU9GEddxdwxS MXVpeNnqrqaGo9VGdV21EBzNjZSP4P.dASFx92SVmKRxZgX0lZkcV48eqb13 5fBqXHS6naG0vJjIR8Uz.GcHDjy7VqOD1almBTYRLQCwKB26Q2Pmkh9MC9Oi 38skfmvZeS4Zgpwyczieqh5R48p9K5.WmE2nbT_fZzCA4TBiaspo85FgugML joc9yrt9YSKjCePBZz6y68T_wxnjuLndfLZci6ugY0gjWqSo6IzqEnx3.2D6 O X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.26] (se@87.158.21.37 with ) by smtp117.mail.ir2.yahoo.com with SMTP; 14 Jul 2013 11:46:12 +0000 UTC Message-ID: <51E28F7B.7090303@freebsd.org> Date: Sun, 14 Jul 2013 13:46:03 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: linnemannr@gmail.com Subject: Re: Attempting to roll back zfs transactions on a disk to recover a destroyed ZFS filesystem References: <51DFF79C.905@gmail.com> In-Reply-To: <51DFF79C.905@gmail.com> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2013 11:46:15 -0000 Am 12.07.2013 14:33, schrieb Volodymyr Kostyrko: > You can try to experiment with zpool hidden flags. Look at this command: > > zpool import -N -o readonly=on -f -R /pool > > It will try to import pool in readonly mode so no data would be written > on it. It also doesn't mount anything on import so if any fs is damaged > you have less chances triggering a coredump. Also zpool import has a > hidden -T switch that gives you ability to select transaction that you > want to try to restore. You'll need a list of available transaction though: > > zdb -ul > > This one when given a vdev lists all uberblocks with their respective > transaction ids. You can take the highest one (it's not the last one) > and try to mount pool with: > > zpool import -N -o readonly=on -f -R /pool -F -T I had good luck with ZFS recovery with the following approach: 1) Use zdb to identify a TXG for which the data structures are intact 2) Select recovery mode by loading the ZFS KLD with "vfs.zfs.recover=1" set in /boot/loader.conf 3) Import the pool with the above -T option referring to a suitable TXG found with the help zdb. The zdb commands to use are: # zdb -AAA -L -t -bcdmu (Both -AAA and -L reduce the amount of consistency checking performed. A pool (at TXG) that needs these options to allow zdb to succeed is damaged, but may still allow recovery of most or all files. Be sure to only import that pool R/O, or your data will probably be lost!) A list of TXGs to try can be retrieved with "zdb -hh ". You may need to add "-e" to the list of zdb options, since the port is exported / not currently mounted). Regards, STefan