diff options
author | David Teigland <teigland@redhat.com> | 2019-10-29 16:08:43 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2019-11-27 11:13:47 -0600 |
commit | 3145a855836c4cf50d4b6064b3e6f1ce4a366aad (patch) | |
tree | a5409755ba31e9d334921874979effba42ec34b6 /tools/vals.h | |
parent | 2e0f2730081554460328b3ac7e28080bd902535c (diff) | |
download | lvm2-3145a855836c4cf50d4b6064b3e6f1ce4a366aad.tar.gz |
pvck: repair headers and metadata
To write a new/repaired pv_header and label_header:
pvck --repairtype pv_header --file <file> <device>
This uses the metadata input file to find the PV UUID,
device size, and data offset.
To write new/repaired metadata text and mda_header:
pvck --repairtype metadata --file <file> <device>
This requires a good pv_header which points to one or two
metadata areas. Any metadata areas referenced by the
pv_header are updated with the specified metadata and
a new mda_header. "--settings mda_num=1|2" can be used
to select one mda to repair.
To combine all header and metadata repairs:
pvck --repair --file <file> <device>
It's best to use a raw metadata file as input, that was
extracted from another PV in the same VG (or from another
metadata area on the same PV.) pvck will also accept a
metadata backup file, but that will produce metadata that
is not identical to other metadata copies on other PVs
and other areas. So, when using a backup file, consider
using it to update metadata on all PVs/areas.
To get a raw metadata file to use for the repair, see
pvck --dump metadata|metadata_search.
List all instances of metadata from the metadata area:
pvck --dump metadata_search <device>
Save one instance of metadata at the given offset to
the specified file (this file can be used for repair):
pvck --dump metadata_search --file <file>
--settings "metadata_offset=<off>" <device>
Diffstat (limited to 'tools/vals.h')
-rw-r--r-- | tools/vals.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/vals.h b/tools/vals.h index db8bae95d..317e4985e 100644 --- a/tools/vals.h +++ b/tools/vals.h @@ -141,6 +141,7 @@ val(syncaction_VAL, syncaction_arg, "SyncAction", "check|repair") val(reportformat_VAL, reportformat_arg, "ReportFmt", "basic|json") val(configreport_VAL, configreport_arg, "ConfigReport", "log|vg|lv|pv|pvseg|seg") val(configtype_VAL, configtype_arg, "ConfigType", "current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata") +val(repairtype_VAL, repairtype_arg, "RepairType", "pv_header|metadata|label_header") /* this should always be last */ val(VAL_COUNT, NULL, NULL, NULL) |