pvscan

Scan the physical volume list of all hard drives in the system

Supplementary instructions

pvscan command will scan all hard disks connected to the system and list the physical volumes found. Use the -n option of the pvscan command to display physical volumes in the hard disk that do not belong to any volume group and are unused.

grammar

pvscan(option)

Options

-d: debug mode;
-e: Only display physical volumes belonging to the output volume group;
-n: Only display physical volumes that do not belong to any volume group;
-s: short format output;
-u: Display UUID.

Example

Use the pvscan command to scan the physical volumes of all hard disks in the current system. Enter the following command on the command line:

[root@localhost ~]# pvscan #Scan the physical volumes on all hard disks

The output information is as follows:

PV /dev/sdb1 lvm2 [101.94 MB]
PV /dev/sdb2 lvm2 [101.98 MB]
Total: 2 [203.92 MB] / in use: 0 [0 ] / in no VG: 2 [203.92
MB]

Note: In this example, two physical volumes are output. They do not belong to any volume group and are exploitable physical volumes.