static const cmdinfo_t metadump_cmd =
{ "metadump", NULL, metadump_f, 0, -1, 0,
- N_("[-e] [-g] [-m max_extent] [-w] [-o] filename"),
+ N_("[-a] [-e] [-g] [-m max_extent] [-w] [-o] filename"),
N_("dump metadata to a file"), metadump_help };
static FILE *outf; /* metadump file */
static int stop_on_read_error = 0;
static int max_extent_size = DEFAULT_MAX_EXT_SIZE;
static int obfuscate = 1;
+static int zero_stale_data = 1;
static int show_warnings = 0;
static int progress_since_warning = 0;
" for compressing and sending to an XFS maintainer for corruption analysis \n"
" or xfs_repair failures.\n\n"
" Options:\n"
+" -a -- Copy full metadata blocks without zeroing unused space\n"
" -e -- Ignore read errors and keep going\n"
" -g -- Display dump progress\n"
" -m -- Specify max extent size in blocks to copy (default = %d blocks)\n"
return 0;
}
- while ((c = getopt(argc, argv, "egm:ow")) != EOF) {
+ while ((c = getopt(argc, argv, "aegm:ow")) != EOF) {
switch (c) {
+ case 'a':
+ zero_stale_data = 0;
+ break;
case 'e':
stop_on_read_error = 1;
break;
OPTS=" "
DBOPTS=" "
-USAGE="Usage: xfs_metadump [-efFogwV] [-m max_extents] [-l logdev] source target"
+USAGE="Usage: xfs_metadump [-aefFogwV] [-m max_extents] [-l logdev] source target"
-while getopts "efgl:m:owFV" c
+while getopts "aefgl:m:owFV" c
do
case $c in
+ a) OPTS=$OPTS"-a ";;
e) OPTS=$OPTS"-e ";;
g) OPTS=$OPTS"-g ";;
m) OPTS=$OPTS"-m "$OPTARG" ";;
.SH SYNOPSIS
.B xfs_metadump
[
-.B \-efFgow
+.B \-aefFgow
] [
.B \-m
.I max_extents
.PP
.SH OPTIONS
.TP
+.B \-a
+Copies entire metadata blocks. Normally,
+.B xfs_metadump
+will zero any stale
+bytes interspersed with in-use metadata. Use this option to copy full metadata
+blocks, to provide more debugging information for a corrupted filesystem. Note
+that the extra data will be unobfuscated.
+.TP
.B \-e
Stops the dump on a read error. Normally, it will ignore read errors and copy
all the metadata that is accessible.