From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 12 14:41:56 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 B637D187 for ; Fri, 12 Jul 2013 14:41:56 +0000 (UTC) (envelope-from linnemannr@gmail.com) Received: from mail-oa0-x22a.google.com (mail-oa0-x22a.google.com [IPv6:2607:f8b0:4003:c02::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 8423A1A2C for ; Fri, 12 Jul 2013 14:41:56 +0000 (UTC) Received: by mail-oa0-f42.google.com with SMTP id j6so13054952oag.1 for ; Fri, 12 Jul 2013 07:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=EqftKSIizxWWGqMIl1x8IUfcA+JH0B/oezBaC2bP3m8=; b=VfMYTkUr0gkkdSLCMoP5Dmthjk7+Z0fPHsdSxo8EgUdFINfvkFdd1yo6IGWdJwNHC5 /pUMx2MlmFiGdIsWPSe92OmyjKxjB42FRLIsPcDCmEpKfHTKGaATJKRzxGDv5sS2p25J eZoExcUC1U7WLJSP+RqilwOpbRXkYbdwUdOCe5/r6Ky0JHSBBMVoQiQg+rRY6K8x3/Fz 3L+9/B/tOkbaAwtTraf0Yufuyq3mcffXOvsWeXsvEfKebiNq4xqwwLAbRtTG65ODD3Gf 0RgQjRFC+3EecAxxPoyU6iYvcI4jDmNkL6EnCSmeoTsNpCxQTR54eKjSocZlo2s/GbVj S5Ag== MIME-Version: 1.0 X-Received: by 10.60.103.211 with SMTP id fy19mr35599737oeb.103.1373640116097; Fri, 12 Jul 2013 07:41:56 -0700 (PDT) Received: by 10.182.122.97 with HTTP; Fri, 12 Jul 2013 07:41:56 -0700 (PDT) In-Reply-To: <51DFF79C.905@gmail.com> References: <51DFF79C.905@gmail.com> Date: Fri, 12 Jul 2013 09:41:56 -0500 Message-ID: Subject: Re: Attempting to roll back zfs transactions on a disk to recover a destroyed ZFS filesystem From: Reid Linnemann To: Volodymyr Kostyrko Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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: Fri, 12 Jul 2013 14:41:56 -0000 Hey presto! /> zfs list NAME USED AVAIL REFER MOUNTPOINT bucket 485G 1.30T 549M legacy bucket/tmp 21K 1.30T 21K legacy bucket/usr 29.6G 1.30T 29.6G /mnt/usr bucket/var 455G 1.30T 17.7G /mnt/var bucket/var/srv 437G 1.30T 437G /mnt/var/srv There's my old bucket! Thanks much for the hidden -T argument, Volodymyr! Now I can get back the remainder of my missing configuration. On Fri, Jul 12, 2013 at 7:33 AM, Volodymyr Kostyrko wrot= e: > 11.07.2013 17:43, Reid Linnemann =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0= =B2(=D0=BB=D0=B0): > > So recently I was trying to transfer a root-on-ZFS zpool from one pair o= f >> disks to a single, larger disk. As I am wont to do, I botched the transf= er >> up and decided to destroy the ZFS filesystems on the destination and sta= rt >> again. Naturally I was up late working on this, being sloppy and drowsy >> without any coffee, and lo and behold I issued my 'zfs destroy -R' and >> immediately realized after pressing [ENTER[ that I had given it the >> source's zpool name. oops. Fortunately I was able to interrupt the >> procedure with only /usr being destroyed from the pool and I was able to >> send/receive the truly vital data in my /var partition to the new disk a= nd >> re-deploy the base system to /usr on the new disk. The only thing I'm >> really missing at this point is all of the third-party software >> configuration I had in /usr/local/etc and my apache data in >> /usr/local/www. >> > > You can try to experiment with zpool hidden flags. Look at this command: > > zpool import -N -o readonly=3Don -f -R /pool > > It will try to import pool in readonly mode so no data would be written o= n > 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=3Don -f -R /pool -F -T > > Then check available filesystems. > > -- > Sphinx of black quartz, judge my vow. >