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|--activate y|n|ay β€” auto-activates LVs in a VG once the PVs that got scanned have completed that VG. (only ay actually works here, so don't get cute with y or n.)
  • -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.
  • --autoactivation String β€” 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 use pvs_online files 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 prints complete or incomplete for 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 and event_activation=0 in the config settings.
  • --commandprofile String β€” the command profile to use for command configuration. Peep lvm.conf(5) for the tea on profiles.
  • --config String β€” config settings for the command, and these override whatever lvm.conf(5) says. The String arg uses the same format as lvm.conf(5), or you can use section/field syntax. More details in lvm.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.
  • --devices PV β€” 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.
  • --devicesfile String β€” a file listing devices that LVM should use. It has to exist in /etc/lvm/devices/ and it's managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings.
  • --driverloaded y|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.
  • --journal String β€” records info in the systemd journal. This is on top of whatever the lvm.conf log/journal setting 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.
  • --lockopt String β€” used to pass options for special cases to lvmlockd. See lvmlockd(8) for more.
  • --longhelp β€” displays long help text.
  • -j|--major Number β€” the major number of a device.
  • --minor Number β€” 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.
  • --profile String β€” an alias for --commandprofile or --metadataprofile, depending on the command.
  • -q|--quiet ... β€” suppresses output and log messages. It overrides --debug and --verbose. Repeat it once to also suppress any prompts with answer 'no'.
  • --reportformat basic|json|json_std β€” overrides the current output format for reports, which is normally defined globally by the report/output_format setting in lvm.conf(5). basic is 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. json produces report output in JSON format. json_std produces report output in JSON format that's more compliant with the JSON standard. See lvmreport(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, k and K both mean 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents the other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is 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 🫢


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