LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pvck

Check and repair LVM physical volume metadata

TLDR

Print LVM on-disk headers and structures
$ sudo pvck /dev/sdX1 --dump headers
copy
Print the current VG metadata text
$ sudo pvck /dev/sdX1 --dump metadata
copy
List all metadata versions found in the metadata area
$ sudo pvck /dev/sdX1 --dump metadata_all
copy
Search for metadata when headers may be damaged
$ sudo pvck /dev/sdX1 --dump metadata_search -f path/to/metadata.txt
copy
Select the second metadata area when printing
$ sudo pvck /dev/sdX1 --dump metadata --settings "mda_num=2"
copy
Repair headers and metadata using a metadata file
$ sudo pvck /dev/sdX1 --repair -f path/to/metadata_file
copy
Repair only PV header and label
$ sudo pvck /dev/sdX1 --repairtype pv_header
copy

SYNOPSIS

pvck [options] PhysicalVolume

DESCRIPTION

pvck checks and repairs LVM metadata on physical volumes. It can dump on-disk headers and structures (labelheader, pvheader, mda_header), examine metadata areas, search for metadata in damaged volumes, and perform repairs using backup metadata files.The --dump option reads and displays metadata without modifying anything. The --repair option writes corrected headers and metadata using a provided backup file. A PV may have up to two metadata areas (front and back), selectable with `--settings "mda_num=2"`.This tool is essential for LVM disaster recovery when physical volume metadata becomes corrupted.

PARAMETERS

--dump type

Dump specified type: headers, metadata, metadataall, metadatasearch.
--repair
Repair LVM metadata on the physical volume.
--repairtype type
Specify repair type: pvheader, metadata, labelheader.
-f, --file file
Input/output file for metadata operations.
--settings settings
Additional settings (e.g., mda_num=2).
--labelsector sector
Sector number to read the PV label from (0-3, default: 1).
-d, --debug
Enable debug output.
-v, --verbose
Enable verbose output.
-y, --yes
Answer yes to all prompts automatically.
-t, --test
Run in test mode without making changes.

CAVEATS

Repair operations can be destructive. Always backup metadata before attempting repairs. Use with extreme caution on production systems.

HISTORY

Part of LVM2 (Logical Volume Manager 2), the standard volume management system for Linux.

SEE ALSO

Copied to clipboard
Kai