← 返回命令列表

Linux command

pvck 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo pvck /dev/sdX1 --dump headers

Example

sudo pvck /dev/sdX1 --dump metadata

Example

sudo pvck /dev/sdX1 --dump metadata_all

Search

sudo pvck /dev/sdX1 --dump metadata_search -f path/to/metadata.txt

Example

sudo pvck /dev/sdX1 --dump metadata --settings "mda_num=2"

Repair

sudo pvck /dev/sdX1 --repair -f path/to/metadata_file

Example

sudo pvck /dev/sdX1 --repairtype pv_header

说明

pvck checks and repairs LVM metadata on physical volumes. It can dump on-disk headers and structures (label_header, pv_header, 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.

参数

--dump _type_
Dump specified type: headers, metadata, metadata_all, metadata_search.
--repair
Repair LVM metadata on the physical volume.
--repairtype _type_
Specify repair type: pv_header, metadata, label_header.
-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.

FAQ

What is the pvck command used for?

pvck checks and repairs LVM metadata on physical volumes. It can dump on-disk headers and structures (label_header, pv_header, 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.

How do I run a basic pvck example?

Run `sudo pvck /dev/sdX1 --dump headers` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --dump _type_ do in pvck?

Dump specified type: headers, metadata, metadata_all, metadata_search.