LinuxCommandLibrary

pvck

Check the health of persistent volumes

SYNOPSIS

pvck [OPTIONS] PhysicalVolumePath [PhysicalVolumePath...]

PARAMETERS

PhysicalVolumePath
    One or more paths to the physical volume(s) to check (e.g., /dev/sdb1).

-d, --dry-run
    Perform a simulated check without making any actual changes to the metadata.

-r, --repair
    Attempt to repair detected metadata corruption. Use with extreme caution and after ensuring recent backups! This operation carries a risk of data loss if not used properly.

-v, --verbose
    Increase the verbosity of the output, showing more details about the check process and findings.

--reportformat {basic|json}
    Specify the output format for the check results, either plain text (basic) or JSON for programmatic parsing.

-h, --help
    Display a help message with command usage and options, then exit.

-V, --version
    Display version information about the pvck command and LVM, then exit.

DESCRIPTION

pvck is an LVM (Logical Volume Manager) command used to
inspect and verify the integrity of the metadata stored on
physical volumes. LVM organizes storage into physical volumes
(PVs), volume groups (VGs), and logical volumes (LVs).
The metadata on PVs contains crucial information about the LVM
structure, including the allocation of extents and details
about the volume group it belongs to.
Corruption of this metadata can lead to unmountable file
systems, lost logical volumes, or even render an entire
volume group unusable.
pvck helps identify such corruption and, with the
appropriate option, can attempt to repair it, making it an
essential tool for maintaining the health and stability of
LVM-managed storage.

CAVEATS

Using the -r (--repair) option can be
dangerous and may lead to data loss if not used correctly
or in cases of severe, unrecoverable corruption.
Always ensure you have recent backups before attempting
any repairs.
pvck primarily checks LVM metadata integrity; it does not
check the integrity of the underlying filesystem on the
logical volumes or the actual data blocks themselves.

METADATA CORRUPTION EXPLAINED

LVM metadata describes the layout of physical
volumes, how they form volume groups, and how logical
volumes are carved out of those groups. Corruption can
occur due to power failures, disk errors, or improper
system shutdowns. Even a single bit flip in critical
metadata can prevent LVM from recognizing its volumes,
making pvck vital for diagnostics and potential recovery.

WHEN TO USE PVCK

pvck should be run if you suspect
LVM metadata issues, such as after a system crash,
unexpected power loss, or when LVM commands fail to
recognize or activate volume groups. It's also a good
precautionary step before performing significant LVM
operations like physical volume migration, resizing, or
adding new physical volumes to a volume group.

HISTORY

pvck is an integral part of the
Logical Volume Manager (LVM) suite of tools. LVM
itself has been a standard feature in Linux distributions
for many years, providing flexible storage management
capabilities. pvck specifically addresses the need for
metadata integrity checks, which are crucial for the
robustness of any volume management system. Its functionality
has evolved alongside LVM, adapting to new features and
ensuring the reliability of physical volume metadata within
modern Linux environments.

SEE ALSO

lvm(8), pvcreate(8), pvdisplay(8), vgck(8), lvck(8), vgchange(8)

Copied to clipboard