vgscan command is a Linux utility used to scan all disks for volume groups and display them on the system. It is a useful tool for system administrators who need to manage storage devices and logical volumes.
vgscan command scans all disks for volume groups and updates the system’s cache file
/etc/lvm/cache/.cache. It then displays a list of all volume groups found on the system. This command is useful when new disks are added to the system, or when the system is booted with new disks.
Here is an example of how to use
$ sudo vgscan Reading all physical volumes. This may take a while... Found volume group "vg01" using metadata type lvm2 Found volume group "vg02" using metadata type lvm2
This output shows that two volume groups,
vg02, were found on the system.
The following table lists all available options for the
||Activates any volume groups found during the scan.|
||Enables debug output.|
||Displays help information and exits.|
||Enables verbose output.|
||Displays version information and exits.|
- If no volume groups are found, make sure that all disks are properly connected and powered on.
- If the cache file
/etc/lvm/cache/.cacheis corrupted, delete the file and run
vgscanagain to regenerate it.
- If the
vgscancommand fails with an error message, check the system logs for more information.
vgscancommand does not create or modify any volume groups. It only scans for existing volume groups and updates the system’s cache file.
- To create a new volume group, use the
- To extend an existing volume group, use the