[ZFS] recover destroyed zpool - what are the available options?

Beeblebrox zaphod at berentweb.com
Sat Jun 14 21:02:56 UTC 2014


This thread comes up on search engines, so it's appropriate to post new
results.

Current ZFS code is able to import the pool in question without complaint
(# zpool import -D -f -R /bsdr -N -F -X 12018916494219117471 rescue)
The pool is now named "rescue". Nice output with the history command:

#zpool history -il rescue
History for 'rescue':
2013-03-30.00:09:06 zpool create -f bsdr ad6p2 [user 0 (root) on
mfsbsd:global]
2013-03-30.00:09:06 [internal pool create txg:5] pool spa 28; zfs spa 28;
zpl 5; uts mfsbsd 8.2-RELEASE 802000 amd64 [user 0 (root) on mfsbsd]
2013-03-30.00:09:14 zpool destroy bsdr [user 0 (root) on mfsbsd:global]
2013-09-07.08:27:51 [txg:12] open pool version 28; software version 5000/5;
uts xxx.xxx
9.2-PRERELEASE 902503 amd64 [on xxx.xxx]
2013-09-07.08:27:51 [txg:14] import pool version 28; software version
5000/5; uts xxx.xxx 9.2-PRERELEASE 902503 amd64 [on xxx.xxx]
2013-09-07.08:27:56 zpool import -D -f -R /mnt -N -F -n -X
12018916494219117471 [user 0 (root) on xxx.xxx]
2013-09-07.08:29:57 zpool export bsdr [user 0 (root) on xxx.xxx]
2013-09-07.11:23:42 [txg:46] open pool version 28; software version 5000/5;
uts xxx.xxx
9.2-PRERELEASE 902503 amd64 [on xxx.xxx]
2013-09-07.11:23:43 [txg:48] import pool version 28; software version
5000/5; uts xxx.xxx 9.2-PRERELEASE 902503 amd64 [on xxx.xxx]
2013-09-07.11:23:48 zpool import -f -R /mnt -N -F -n -X bsdr [user 0 (root)
on xxx.xxx]
2013-09-07.11:25:12 zpool export bsdr [user 0 (root) on xxx.xxx]
2013-09-07.11:25:30 [txg:72] open pool version 28; software version 5000/5;
uts xxx.xxx
9.2-PRERELEASE 902503 amd64 [on xxx.xxx]
2013-09-07.11:25:30 [txg:74] import pool version 28; software version
5000/5; uts xxx.xxx 9.2-PRERELEASE 902503 amd64 [on xxx.xxx]
2013-09-07.11:25:36 zpool import -R /mnt bsdr [user 0 (root) on xxx.xxx]
2013-09-07.11:27:11 zpool destroy bsdr [user 0 (root) on xxx.xxx]
2014-06-14.22:28:26 [txg:104] open pool version 28; software version 5000/5;
uts xxx.xxx 11.0-CURRENT 1100022 amd64 [on xxx.xxx]
2014-06-14.22:28:31 [txg:106] import pool version 28; software version
5000/5; uts xxx.xxx
11.0-CURRENT 1100022 amd64 [on xxx.xxx]
2014-06-14.22:28:40 zpool import -D -f -R /bsdr -N -F -X
12018916494219117471 rescue [user 0
(root) on xxx.xxx]
2014-06-14.22:31:36 zpool export rescue [user 0 (root) on xxx.xxx]
2014-06-14.22:37:40 [txg:149] open pool version 28; software version 5000/5;
uts xxx.xxx 11.0-CURRENT 1100022 amd64 [on xxx.xxx]
2014-06-14.22:37:46 [txg:151] import pool version 28; software version
5000/5; uts xxx.xxx
11.0-CURRENT 1100022 amd64 [on xxx.xxx]
2014-06-14.22:37:55 zpool import rescue [user 0 (root) on xxx.xxx]
2014-06-14.22:38:26 zpool export rescue [user 0 (root) on xxx.xxx]
2014-06-14.22:39:34 [txg:167] open pool version 28; software version 5000/5;
uts xxx.xxx 11.0-CURRENT 1100022 amd64 [on xxx.xxx]
2014-06-14.22:39:40 [txg:169] import pool version 28; software version
5000/5; uts xxx.xxx
11.0-CURRENT 1100022 amd64 [on xxx.xxx]
2014-06-14.22:39:48 zpool import rescue [user 0 (root) on xxx.xxx]

PROBLEM: Unfortunately, even though zpool gets mounted 'ls' shows nothing.
Therefore, I need to rollback the ZFS history. I have found two options for
this:
1. Manual (using history output)
2. This script:
http://www.solarisinternals.com/wiki/index.php/ZFS_forensics_scrollback_script
There are many other resources, but the above seems to have boiled it down
to the essence. On the down side, I modified the script to only list its
findings rather than actually do the disk write and ran it. Two hours later
script + HDD is still working (I suppose that should be expected).

I really have no preference regarding methods other than what is the most
simple and direct one, but I choose to ask for input before trying it on the
HDD to be rescued.

Regards.




-----
FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
--
View this message in context: http://freebsd.1045724.n5.nabble.com/ZFS-recover-destroyed-zpool-what-are-the-available-options-tp5800299p5920849.html
Sent from the freebsd-questions mailing list archive at Nabble.com.


More information about the freebsd-questions mailing list