public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs mailing list <xfs@oss.sgi.com>
Subject: [PATCH] xfs_metadump: Allow operation on frozen filesystems
Date: Mon, 20 Jul 2009 14:07:15 -0500	[thread overview]
Message-ID: <4A64C063.2070807@sandeen.net> (raw)

The xfs_metadump manpage says that it works on a frozen filesystem,
but in reality it does not, and fails because the fs still looks
mounted & writable.

I don't think we have a way to test for frozen (!) so add a -F 
option which essentially overrides the xfs_db "-i" option with
a later "-r" which is more forgiving.

Document this, and a few other missing bits in the manpage.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

iff --git a/db/xfs_metadump.sh b/db/xfs_metadump.sh
index 28b04b8..ef51678 100755
--- a/db/xfs_metadump.sh
+++ b/db/xfs_metadump.sh
@@ -5,9 +5,9 @@
 
 OPTS=" "
 DBOPTS=" "
-USAGE="Usage: xfs_metadump [-efogwV] [-m max_extents] [-l logdev] source target"
+USAGE="Usage: xfs_metadump [-efogwFV] [-m max_extent] [-l logdev] source target"
 
-while getopts "efgl:m:owV" c
+while getopts "efgl:m:owFV" c
 do
 	case $c in
 	e)	OPTS=$OPTS"-e ";;
@@ -17,6 +17,7 @@ do
 	w)	OPTS=$OPTS"-w ";;
 	f)	DBOPTS=$DBOPTS" -f";;
 	l)	DBOPTS=$DBOPTS" -l "$OPTARG" ";;
+	F)	DBOPTS=$DBOPTS" -r";;
 	V)	xfs_db -p xfs_metadump -V
 		status=$?
 		exit $status
@@ -29,7 +30,7 @@ done
 set -- extra $@
 shift $OPTIND
 case $# in
-	2)	xfs_db$DBOPTS -F -i -p xfs_metadump -c "metadump$OPTS $2" $1
+	2)	xfs_db -F -i $DBOPTS -p xfs_metadump -c "metadump$OPTS $2" $1
 		status=$?
 		;;
 	*)	echo $USAGE 1>&2
diff --git a/man/man8/xfs_metadump.8 b/man/man8/xfs_metadump.8
index f0ff1ae..1f74dd4 100644
--- a/man/man8/xfs_metadump.8
+++ b/man/man8/xfs_metadump.8
@@ -4,11 +4,15 @@ xfs_metadump \- copy XFS filesystem metadata to a file
 .SH SYNOPSIS
 .B xfs_metadump
 [
-.B \-efgow
+.B \-efgowFV
 ] [
 .B \-l
 .I logdev
 ]
+] [
+.B \-m
+.I max_extent
+]
 .I source
 .I target
 .SH DESCRIPTION
@@ -28,7 +32,10 @@ redirected to another program such as a compression application.
 .B xfs_metadump
 should only be used to copy unmounted filesystems, read-only mounted
 filesystems, or frozen filesystems (see
-.BR xfs_freeze (8)).
+.BR xfs_freeze (8)
+and the
+.B \-F
+option below).
 Otherwise, the generated dump could be inconsistent or corrupt.
 .PP
 .B xfs_metadump
@@ -94,12 +101,28 @@ For filesystems which use an external log, this specifies the device where the
 external log resides. The external log is not copied, only internal logs are
 copied.
 .TP
+.BI \-m " max_extent"
+Specify the maximum size of a metadata extent to process, in filesystem blocks.
+Anything larger than this will be considered corrupt metadata, and skipped.
+The default is 1000 blocks.
+.TP
 .B \-o
 Disables obfuscation of file names and extended attributes.
 .TP
 .B \-w
 Prints warnings of inconsistant metadata encountered to stderr. Bad metadata
 is still copied.
+.TP
+.B \-F
+Allows a metadump of a filesystem frozen with
+.BR xfs_freeze (8).
+This overrides the normal tests that the fileystem is either unmounted
+or readonly; because there is no way to test for a frozen filesystem,
+this option must be manually specified.  Specifying this option on a 
+writable, non-frozen filesystem will likely result in a corrupted dump image.
+.TP
+.B \-V
+Prints out the current version number and exits.
 .SH DIAGNOSTICS
 .B xfs_metadump
 returns an exit code of 0 if all readable metadata is succesfully copied or

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2009-07-20 19:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-20 19:07 Eric Sandeen [this message]
2009-07-20 20:39 ` [PATCH] xfs_metadump: Allow operation on frozen filesystems Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A64C063.2070807@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox