xfs_metadump: Allow operation on frozen filesystems
PATCH 1/1 xfs_metadump: Allow operation on frozen filesystems
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.
---
iff --git a/db/xfs_metadump.sh b/db/xfs_metadump.sh index 28b04b8..ef51678 100755
db/xfs_metadump.sh +4 -3
@@ -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
man/man8/xfs_metadump.8 +25 -2
@@ -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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Eric Sandeen
The
xfs_metadumpmanpage 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.
Hmm, that feels a bit dagerous to me. What about just adding an option to xfs_metadump to freeze the filesystem itself before performing the dump and then unfreeze it when done?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs