LinuxCommandLibrary

pvck

Check the health of persistent volumes

TLDR

Print LVM on-disk headers and structures (label, PV header, MDA header, metadata area)

$ sudo pvck [/dev/sdXN] --dump headers
copy

Print the current VG metadata text
$ sudo pvck [/dev/sdXN] --dump metadata
copy

List all metadata versions found in the metadata area
$ sudo pvck [/dev/sdXN] --dump metadata_all
copy

Search common locations for metadata when headers may be damaged, and save it to a file
$ sudo pvck [/dev/sdXN] --dump metadata_search [[-f|--file]] [path/to/metadata.txt]
copy

Select the second metadata area (mda2) when printing metadata
$ sudo pvck [/dev/sdXN] --dump metadata --settings "mda_num=2"
copy

Repair headers and metadata using a metadata input file (use with care)
$ sudo pvck [/dev/sdXN] --repair [[-f|--file]] [path/to/metadata_file]
copy

Repair only the PV header and label header
$ sudo pvck [/dev/sdXN] --repairtype pv_header
copy

SYNOPSIS

pvck [options] [PV|VG|Tag|Selectors ...]

PARAMETERS

-d, --debug […]
    Enable debug messages (repeatable for more detail).

--devices PV
    Restrict to devices with PVs belonging to specified VG.

--devicesfile DevicesFile
    Use PV devices listed in the given file.

--driverloaded y|n
    Override LVM driver detection.

--help, -?, -h
    Display help text.

--journal
    Read data from lvmetad journal instead of disk.

--metadatatype lvm2
    Specify metadata type (default: lvm2).

-q, --quiet
    Suppress non-error messages.

--repair
    Attempt to repair corrupted PV metadata (use cautiously).

--reportformat string
    Override default output format.

-v, --verbose
    Increase output verbosity.

--version
    Print version information.

--uuid
    Generate new UUIDs for PVs missing them.

--vgssilent
    Suppress warnings about unknown VGs in reports.

DESCRIPTION

pvck is a utility from the LVM2 suite that examines and validates the metadata on physical volumes (PVs) managed by the Logical Volume Manager. It scans PV labels, metadata areas, checksums, and structures for corruption, inconsistencies, or missing data.

When invoked without arguments, it checks all recognized PVs on the system. You can specify particular devices, volume groups (VGs), tags, or selectors to limit the scope. The tool reports issues like invalid headers, mismatched UUIDs, or damaged backup metadata copies.

It's essential for troubleshooting LVM issues after disk errors, power failures, or migrations. With --repair, it attempts to fix problems by rewriting metadata from backups, but this should be used cautiously.

pvck relies on kernel device access and lvm.conf settings, operating non-destructively unless repair is enabled. Output includes detailed error locations and suggestions for recovery tools like pvcreate --uuid or vgcfgrestore.

CAVEATS

Requires root privileges.
Non-destructive unless --repair used, which risks data loss.
Does not detect hardware-level corruption; pair with badblocks.
Only supports LVM2 metadata.

EXIT STATUS

0: All PVs OK.
1: Some PVs failed.
2: Command syntax error.
3: No PVs found.

EXAMPLES

pvck
Check all PVs.

pvck /dev/sdb1
Check specific PV.

pvck --repair my_vg
Repair PVs in VG (dangerous).

HISTORY

Part of LVM2 since version 2.00 (2004), developed by Heinz Mauelshagen and Red Hat LVM team. Enhanced with repair options and better reporting in later releases (e.g., 2.02+).

SEE ALSO

lvm(8), pvscan(8), vgck(8), pvcreate(8), vgcfgrestore(8)

Copied to clipboard