snmetadump(1) snmetadump(1)
NAME
snmetadump - Save and process a copy of the Xsan File System metadata
SYNOPSIS
snmetadump [ [-d [-c]] [-a [-m] [-j <journal_file> [-j <journal_file>]
...]] [-r] [-x] [-b] [-D <n>] [-f <dump file>] ] [ FsName ]
DESCRIPTION
The snmetadump utility provides the ability to create a copy of the
volume metadata for use in restoring a volume after a disaster. If some
portion of the Xsan volume is lost, the volume metadata can be restored
from a copy of the metadata dump file.
In a managed Xsan environment the metadata is kept up to date using
special restore journal files. These restore journals describe the
metadata updates that must be applied to a metadata dump to bring the
dump up to date with the current volume metadata. In the case of a dis-
aster and metadata recovery all managed files on the volume will be
restored as long as they had been stored to tape. When the volume is
accessed after the metadata has been restored all files are in the
"tape-only" state, meaning that the file will contain the data of the
last copy stored. On a managed volume the process of keeping a metadata
dump up to date by applying restore journal files is performed by the
daily backup processing.
A Xsan metadata dump has limited uses in a non-managed environment. On
a non-managed volume the dump only matches the state of the metadata
until the file system manager (FSM) process is started. After this
point metadata and data will have changed and the dump file is out of
date. However, saving a copy of the metadata is valuable during signif-
icant volume or hardware configuration changes, and during software
upgrades. If accidental misconfiguration or data loss is encountered
the metadata dump can be used to restore the state of the metadata.
NOTES
When saving a copy of the metadata it is recommended that copies of the
volume configuration files are saved too.
It is always recommended that cvfsck(1) is run before a metadata dump
is saved. This will ensure that there are no metadata inconsistencies
copied to the metadata dump.
WARNING: Incorrect usage of this utility can result in data loss.
Always refer to the Xsan documentation before using this utility.
USAGE
-a Apply Metadata Changes - required after a new dump is created
in order for the Storage Manager to read the dump file. This
option will also close the current restore journal, open a new
restore journal, then locate and apply the restore journals that
need to be applied to the metadata dump. The backup process will
invoke snmetadump with this option as part of the nightly backup
on a managed volume.
-b Display the build information for this binary
-c This option can only be run with the -d option. Clean up meta-
data dump, restore journal and temporary files associated with a
volume. When a new metadata dump is generated, previous restore
journals are no longer needed or valid. When invoked with this
option, snmetadump will check the metadump directory for files
to clean up. This option cannot be undone, so it is recommended
that all existing dump and restore journal files be backed up
prior to execution.
-d Dump Metadata - Read in the volume metadata and save a copy to a
metadata dump file. This file can later be used to replace lost
metadata in the case of system failure.
-D Turn on debugging flags (useful for support personnel only).
-f Specify the name of the dump file to create or process. If no -f
argument is given then the default dump file will be used. The
default is /Library/Logs/Xsan/database/metadumps/metad-
ump.<FsName>
-j Apply the specified restore journal to the metadata dump. NOTE:
Normally, this option would be used only if there is a journal
that needs to be applied manually just prior to filesystem
restoration. This option is needed only if a journal needs to
be applied outside of normal -a processing. After using -j to
apply a journal, snmetadump can no longer track which journals
have or need to be applied, so either the metadata dump must be
used to restore the filesystem or a new metadump needs to be
created.
-m Perform special processing for managed volumes - When preparing
a metadata dump for a volume metadata restore, the -m flag must
be included with the -a flag. This flag tells snmetadump to for-
mat the files on the volume so that their data will be read from
the copy on tape.
-r Restore Metadata - Read metadata state from the dump file and
rebuild the volume metadata. All Xsan binaries and configura-
tion files must be restored before this step can be processed.
-x Examine a metadata dump - Verify the format of the metadata dump
MORE NOTES
A lock file is used to ensure that only one snmetadump process is using
the metadata dump at any time. If the lock file exists when a new
snmetadump process is started, snmetadump will exit immediately and
return a specific error code.
If a snmetadump process fails it is possible for the metadata dump lock
file to be left. If this occurs the lock must be manually cleaned up
after verifying that another snmetadump process is not using the dump
file. The lock file is located in the same directory as the metadata
dump and is named metadump.<fsname>.lock by default. If the -f option
is used the lockfile name will match the passed in dumpfile name with
.lock appended.
On a managed volume it is important to note that snmetadump is a single
piece of a larger backup and restore procedure. Be sure to refer to the
Xsan documentation before attempting to use this utility.
Incorrect usage of this utility may result in data loss.
The snmetadump utility depends on adequate free metadata space to
recover file system metadata. It is recommended that managed Xsan file
system use exclusive metadata stripe groups to prevent data files from
taking up needed metadata space. In the case where the snmetadump util-
ity determines that there is not enough metadata space to manage disas-
ter recovery snmetadump will fail and recommend that an additional
metadata stripe group be added. See the cvupdatefs(1) man page for more
details on adding stripe groups.
RETURN VALUES
0 - Success
1 - Failure - There was an error processing the metadata dump
2 - Dump Busy - The dump is being processed by another instance of
snmetadump. Try again later. See MORE NOTES section.
FILES
/Library/Logs/Xsan/database/metadumps/metadump.*
Default name of a volume metadata dump file
metadump.*.lock
Name of the metadata dump lock file
/Library/Logs/Xsan/database/metadumps/restore_journal.*
Default name of restore journal files
/Library/Logs/Xsan/data/*
/Library/Preferences/Xsan/*.cfg
SEE ALSO
cvfs_config(4), cvmkfile(1), cvfsck(1), cvupdatefs(1), cvadmin(1)
Xsan File System December 2005 snmetadump(1)
Mac OS X 10.7 - Generated Sat Aug 20 10:00:10 CDT 2011
