← 返回命令列表

Linux command

pvdisplay 命令

安全

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

常用示例

Show every physical volume

sudo pvdisplay

Show one specific PV

sudo pvdisplay [/dev/sda2]

Include the map of physical extents

sudo pvdisplay --maps [/dev/sda2]

Short / columnar output

sudo pvdisplay -s

Only show PVs in a given volume group

sudo pvdisplay --select "vg_name=[vg0]"

Display sizes in human units

sudo pvdisplay --units h

JSON-formatted output

sudo pvdisplay --reportformat json

说明

pvdisplay prints per-PV information: device name, owning volume group, PV size, physical-extent (PE) size, total / free / allocated extent counts, allocation policy, UUID, and status. With `--maps` it also lists which logical-extent ranges of which LVs each PE belongs to — useful when planning evacuations with `pvmove` or sanity-checking device failures. For scriptable output, prefer `pvs` (short/columnar, tunable column list) or `pvdisplay -c`.

参数

-v, --verbose
Print more detail (repeatable: `-vv`, `-vvv` for more).
-m, --maps
Show the mapping of physical extents on this PV to the logical extents of each LV that uses it.
-s, --short
Short-form output — just name and size.
-c, --colon
Output as a colon-separated single line per PV (scriptable).
-C, --columns
Alias for running `pvs(8)`-style columnar output.
--units _u_
Report sizes in units _u_: `b`, `k`/`K`, `m`/`M`, `g`/`G`, `t`/`T`, `h` (human). Lower-case = SI (powers of 1000); upper-case = IEC (powers of 1024).
--select _SELECTION_
Filter to PVs matching a selection expression (e.g. `vg_name=vg0`, `pv_size>10g`).
--reportformat _FMT_
`basic`, `json`, or `json_std`.
--foreign
Show PVs owned by other hosts (shared storage).
--ignorelockingfailure
Continue even if file/locking fails (read-only operations).
--nolocking
Disable locking (for debugging / read-only rescue).
--help
Show help.

FAQ

What is the pvdisplay command used for?

pvdisplay prints per-PV information: device name, owning volume group, PV size, physical-extent (PE) size, total / free / allocated extent counts, allocation policy, UUID, and status. With `--maps` it also lists which logical-extent ranges of which LVs each PE belongs to — useful when planning evacuations with `pvmove` or sanity-checking device failures. For scriptable output, prefer `pvs` (short/columnar, tunable column list) or `pvdisplay -c`.

How do I run a basic pvdisplay example?

Run `sudo pvdisplay` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v, --verbose do in pvdisplay?

Print more detail (repeatable: `-vv`, `-vvv` for more).