From 9867e8be2a7182ce9b5eb28ed1d142e2ee60d69d Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Fri, 1 Jan 2016 14:42:58 +0100 Subject: Illumos 4891 - want zdb option to dump all metadata 4891 want zdb option to dump all metadata Reviewed by: Sonu Pillai Reviewed by: George Wilson Reviewed by: Christopher Siden Reviewed by: Dan McDonald Reviewed by: Richard Lowe Approved by: Garrett D'Amore We'd like a way for zdb to dump metadata in a machine-readable format, so that we can bring that back from a customer site for in-house diagnosis. Think of it as a crash dump for zpools, which can be used for post-mortem analysis of a malfunctioning pool References: https://www.illumos.org/issues/4891 https://github.com/illumos/illumos-gate/commit/df15e41 Porting notes: - [cmd/zdb/zdb.c] - a5778ea zdb: Introduce -V for verbatim import - In main() getopt 'opt' variable removed and the code was brought back in line with illumos. - [lib/libzpool/kernel.c] - 1e33ac1 Fix Solaris thread dependency by using pthreads - f0e324f Update utsname support - 4d58b69 Fix vn_open/vn_rdwr error handling - In vn_open() allocate 'dumppath' on heap instead of stack - Properly handle 'dump_fd == -1' error path - Free 'realpath' after added vn_dumpdir_code block Ported-by: kernelOfTruth kerneloftruth@gmail.com Signed-off-by: Brian Behlendorf --- man/man8/zdb.8 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'man') diff --git a/man/man8/zdb.8 b/man/man8/zdb.8 index faae3aa54..efa1f41eb 100644 --- a/man/man8/zdb.8 +++ b/man/man8/zdb.8 @@ -11,7 +11,7 @@ .\" .\" .\" Copyright 2012, Richard Lowe. -.\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" Copyright (c) 2012, 2014 by Delphix. All rights reserved. .\" .TH "ZDB" "8" "February 15, 2012" "" "" @@ -20,7 +20,7 @@ .SH "SYNOPSIS" \fBzdb\fR [-CumdibcsDvhLMXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] - [-U \fIcache\fR] [-I \fIinflight I/Os\fR] + [-U \fIcache\fR] [-I \fIinflight I/Os\fR] [-x \fIdumpdir\fR] [\fIpoolname\fR [\fIobject\fR ...]] .P @@ -372,6 +372,20 @@ Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The \fB-p\fR flag specifies the path under which devices are to be searched. .RE +.sp +.ne 2 +.na +\fB-x\fR \fIdumpdir\fR +.ad +.sp .6 +.RS 4n +All blocks accessed will be copied to files in the specified directory. +The blocks will be placed in sparse files whose name is the same as +that of the file or device read. zdb can be then run on the generated files. +Note that the \fB-bbc\fR flags are sufficient to access (and thus copy) +all metadata on the pool. +.RE + .sp .ne 2 .na -- cgit v1.2.3