PVSCAN(8)
okay bestie, welcome to pvscan(8) β yes, the PVSCAN(8) manual, straight from the System Manager's Manual. she's an 8, she's iconic, and she's about to spill how to list all physical volumes. no cap. π
β¨ NAME β¨
pvscan β List all physical volumes
π¦ SYNOPSIS π¦
okay so the command shape is literally this, and we're keeping it exact because flags are sacred:
pvscan option_args position_args
[ option_args ]
[ position_args ]
and here's the whole flag lineup, character for character, because we do not abbreviate, merge, or ghost any of them:
-a|--activate y|n|ay
-A|--allpvs
--autoactivation String
--cache
--checkcomplete
--commandprofile String
--config String
-d|--debug ...
--devices PV
--devicesfile String
--driverloaded y|n
-e|--exported
-h|--help
--ignorelockingfailure
--journal String
--listlvs
--listvg
--lockopt String
--longhelp
-j|--major Number
--minor Number
--nohints
--nolocking
--noudevsync
-n|--novolumegroup
--profile String
-q|--quiet ...
--reportformat basic|json|json_std
-s|--short
-t|--test
--udevoutput
-u|--uuid
-v|--verbose ...
--version
--vgonline
-y|--yes
that's a whole lot of options and yes, every single one is invited. π
π DESCRIPTION π
When you run pvscan without the --cache option, it lists PVs on the system, like pvs(8) or pvdisplay(8). simple. clean. iconic.
When --cache is used, pvscan updates runtime lvm state on the system, or with -aay it performs autoactivation. okay multitasking queen! β¨
pvscan --cache device
If device is present, lvm records that the PV on device is online. If device is not present, lvm removes the online record for the PV. pvscan only reads the named device.
pvscan --cache
Updates the runtime state for all lvm devices.
pvscan --cache -aay device
Performs the --cache steps for the device, then checks if the VG using the device is complete. If so, LVs in the VG are autoactivated, the same as vgchange -aay vgname would do. (A device name may be replaced with major and minor numbers.)
pvscan --cache -aay
Performs the --cache steps for all devices, then autoactivates any complete VGs.
pvscan --cache --listvg|--listlvs device
Performs the --cache steps for the device, then prints the name of the VG using the device, or the names of LVs using the device. --checkcomplete is usually included to check if all PVs for the VG or LVs are online. When this command is called by a udev rule, the output must conform to udev rule specifications (see --udevoutput). The udev rule will use the results to perform autoactivation.
Autoactivation of VGs or LVs can be enabled/disabled using vgchange or lvchange with --setautoactivation y|n, or by adding names to lvm.conf(5) activation/auto_activation_volume_list.
See lvmautoactivation(7) for more information about how pvscan is used for autoactivation.
π USAGE π
okay bestie, here's every usage mode, in order, with zero flags left behind. π
π Display PV information.
pvscan
[ -A|--allpvs ]
[ -e|--exported ]
[ -n|--novolumegroup ]
[ -s|--short ]
[ -u|--uuid ]
[ --ignorelockingfailure ]
[ --reportformat basic|json|json_std ]
[ COMMON_OPTIONS ]
π Record that a PV is online or offline.
pvscan --cache
[ -j|--major Number ]
[ --ignorelockingfailure ]
[ --minor Number ]
[ --noudevsync ]
[ --reportformat basic|json|json_std ]
[ COMMON_OPTIONS ]
[ String|PV ... ]
π Record that a PV is online and autoactivate the VG if complete.
pvscan --cache -a|--activate y|n|ay
[ -j|--major Number ]
[ --autoactivation String ]
[ --ignorelockingfailure ]
[ --minor Number ]
[ --noudevsync ]
[ --reportformat basic|json|json_std ]
[ COMMON_OPTIONS ]
[ String|PV ... ]
π¦ Record that a PV is online and list the VG using the PV.
pvscan --cache --listvg PV
[ --autoactivation String ]
[ --checkcomplete ]
[ --ignorelockingfailure ]
[ --udevoutput ]
[ --vgonline ]
[ COMMON_OPTIONS ]
πΈ Record that a PV is online and list LVs using the PV.
pvscan --cache --listlvs PV
[ --checkcomplete ]
[ --ignorelockingfailure ]
[ --vgonline ]
[ COMMON_OPTIONS ]
β List LVs using the PV.
pvscan --listlvs PV
[ COMMON_OPTIONS ]
π List the VG using the PV.
pvscan --listvg PV
[ COMMON_OPTIONS ]
π«Ά Common options for lvm:
[ -d|--debug ... ]
[ -h|--help ]
[ -q|--quiet ... ]
[ -t|--test ]
[ -v|--verbose ... ]
[ -y|--yes ]
[ --commandprofile String ]
[ --config String ]
[ --devices PV ]
[ --devicesfile String ]
[ --driverloaded y|n ]
[ --journal String ]
[ --lockopt String ]
[ --longhelp ]
[ --nohints ]
[ --nolocking ]
[ --profile String ]
[ --version ]
π OPTIONS π
okay bestie buckle UP, this is the whole flag menu and there is a LOT, but every single one is here, no skips, no cap π«Ά
-a|--activatey|n|ayβ auto-activates LVs in a VG once the PVs that got scanned have completed that VG. (onlyayactually works here, so don't get cute withyorn.)-A|--allpvsβ shows you info about PVs sitting outside the devices file. For PVs that ARE in the devices file, it displays their device ID.--autoactivationString β tells the command whether autoactivation is happening from an event. This is what lets it apply event-activation-specific settings, like device scanning optimizations that usepvs_onlinefiles made by event-based pvscans. β¨--cacheβ scans one or more devices and records that they're online.--checkcompleteβ checks whether all the devices a VG or LV uses are actually present, then printscompleteorincompletefor each VG or LV you listed. This is part of event-based autoactivation, so heads up: pvscan will do literally nothing if this option is set andevent_activation=0in the config settings.--commandprofileString β the command profile to use for command configuration. Peeplvm.conf(5)for the tea on profiles.--configString β config settings for the command, and these override whateverlvm.conf(5)says. The String arg uses the same format aslvm.conf(5), or you can usesection/fieldsyntax. More details inlvm.conf(5).-d|--debug... β sets the debug level. Repeat it 1 to 6 times to crank up how detailed the messages going to the log file and/or syslog (if configured) are.--devicesPV β restricts which devices are visible and accessible to the command. Devices you don't list will look like they're missing π». This option can be repeated, or it accepts a comma-separated list of devices. This overrides the devices file.--devicesfileString β a file listing devices that LVM should use. It has to exist in/etc/lvm/devices/and it's managed with thelvmdevices(8)command. This overrides thelvm.conf(5)devices/devicesfileanddevices/use_devicesfilesettings.--driverloadedy|nβ if you set it to no, the command won't even try to use device-mapper. For testing and debugging only, bestie.-e|--exportedβ only shows PVs belonging to exported VGs.-h|--helpβ displays help text. the classic π--ignorelockingfailureβ lets a command carry on with read-only metadata operations after locking failures.--journalString β records info in the systemd journal. This is on top of whatever thelvm.conflog/journalsetting already turns on.command: records info about the command.output: records the default command output.debug: records full command debugging.--listlvsβ prints a list of LVs that use the device. π--listvgβ prints the VG that uses the device.--lockoptString β used to pass options for special cases to lvmlockd. Seelvmlockd(8)for more.--longhelpβ displays long help text.-j|--majorNumber β the major number of a device.--minorNumber β the minor number of a device.--nohintsβ don't use the hints file to locate devices for PVs. When hints aren't used, a command might read more devices to find PVs. It'll still do standard hint file invalidation where that's appropriate.--nolockingβ disables locking. use with EXTREME caution π«£ concurrent commands may produce incorrect results.--noudevsyncβ disables udev synchronization. The process will not wait for notification from udev, and it'll keep going regardless of any possible udev processing happening in the background. Only use this if udev isn't running, or if it has rules that ignore the devices LVM creates.-n|--novolumegroupβ only shows PVs that don't belong to any VG.--profileString β an alias for--commandprofileor--metadataprofile, depending on the command.-q|--quiet... β suppresses output and log messages. It overrides--debugand--verbose. Repeat it once to also suppress any prompts with answer 'no'.--reportformatbasic|json|json_stdβ overrides the current output format for reports, which is normally defined globally by thereport/output_formatsetting inlvm.conf(5).basicis the original format with columns and rows. If there's more than one report per command, each report gets prefixed with the report name so you can tell them apart.jsonproduces report output in JSON format.json_stdproduces report output in JSON format that's more compliant with the JSON standard. Seelvmreport(7)for more. π-s|--shortβ short listing format.-t|--testβ runs in test mode, so commands won't update metadata. It's implemented by disabling all metadata writing but still returning success to the calling function. ngl this may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it thinks has changed but actually hasn't.--udevoutputβ command output is modified so it can be imported by a udev rule.-u|--uuidβ shows UUIDs in addition to device names.-v|--verbose... β sets the verbose level. Repeat it 1 to 4 times to increase how detailed the messages sent to stdout and stderr are.--versionβ displays version information.--vgonlineβ the first command to see a complete VG will report it uniquely. Other commands that see the complete VG will report it differently. β¨-y|--yesβ doesn't prompt for confirmation interactively, just always assumes the answer is yes. use with extreme caution, fr fr. (For automatic no, see-qq.)
π¦ VARIABLES π¦
PVβ Physical Volume name, a device path under/dev. For commands that manage physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to the end.
Start and end range (inclusive): PV[:PE-PE] ...
Start and length range (counting from 0): PV[:PE+PE] ...
Stringβ see the option description for info about what the string content should be.Size[UNIT]β Size is an input number that accepts an optional unit. Input units are ALWAYS treated as base two values, no matter the capitalization β so like,kandKboth mean 1024. The default input unit is specified by letter, followed by|UNIT. UNIT represents the other possible input units:b|Bis bytes,s|Sis sectors of 512 bytes,k|Kis KiB,m|Mis MiB,g|Gis GiB,t|Tis TiB,p|Pis PiB,e|Eis EiB. (don't confuse this with the output control--units, where capital letters mean a multiple of 1000 β different vibes entirely π)
πΈ ENVIRONMENT VARIABLES πΈ
See lvm(8) for the info about environment variables that lvm uses. For example, LVM_VG_NAME can generally be substituted for a required VG parameter. π
π«Ά SEE ALSO π«Ά
lvm(8),lvm.conf(5),lvmconfig(8),lvmdevices(8),pvchange(8),pvck(8),pvcreate(8),pvdisplay(8),pvmove(8),pvremove(8),pvresize(8),pvs(8),pvscan(8),vgcfgbackup(8),vgcfgrestore(8),vgchange(8),vgck(8),vgcreate(8),vgconvert(8),vgdisplay(8),vgexport(8),vgextend(8),vgimport(8),vgimportclone(8),vgimportdevices(8),vgmerge(8),vgmknodes(8),vgreduce(8),vgremove(8),vgrename(8),vgs(8),vgscan(8),vgsplit(8),lvcreate(8),lvchange(8),lvconvert(8),lvdisplay(8),lvextend(8),lvreduce(8),lvremove(8),lvrename(8),lvresize(8),lvs(8),lvscan(8),lvm-fullreport(8),lvm-lvpoll(8),blkdeactivate(8),lvmdump(8),dmeventd(8),lvmpolld(8),lvmlockd(8),lvmlockctl(8),lvmdbusd(8),fsadm(8),lvmsystemid(7),lvmreport(7),lvmcache(7),lvmraid(7),lvmthin(7),lvmvdo(7),lvmautoactivation(7)
and that's the whole page bestie, you ate that π this lil gem comes courtesy of Red Hat, Inc., it's LVM TOOLS 2.03.44(2), dated 2026-10-27, and yes it's literally PVSCAN(8) the whole way through. go forth and scan those physical volumes, mwah πβ¨
π¦ where this page comes from
- arch rolling: lvm2 2.03.44-1 Β· GPL-2.0-only AND LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms