lvmdiskscan Command Examples in Linux

The lvmdiskscan command scans all available drives for LVM-configured partitions. lvmdiskscan scans all SCSI, (E)IDE disks, multiple devices, and a bunch of other block devices in the system looking for LVM physical volumes. The size reported is the real device size.

The lvmdiskscan only has one option “-l” or “–lvmpartition” which reports only the physical volume. To scan all the devices, do not provide any argument to the command.

lvmdiskscan Command Examples

1. The lvmdiskscan command can be used to view a list of the LVM devices on your system. Invoking the program using the -l argument, it will list only the LVM devices that are present on your system:

# lvmdiskscan -l
  WARNING: only considering LVM devices
  /dev/hdc1    [       24.41 GB] LVM physical volume
  /dev/hda2    [       74.43 GB] LVM physical volume
  0 LVM physical volume whole disks
  2 LVM physical volumes

2. The lvmdiskscan command can also list all partitions that could be used as physical volumes for logical volume groups:

# lvmdiskscan
  /dev/hda1    [      101.94 MB]
  /dev/myflash [      124.98 MB]
  /dev/hdc1    [       24.41 GB] LVM physical volume
  /dev/hda2    [       74.43 GB] LVM physical volume
  /dev/hdc2    [       24.41 GB]
  /dev/hdc3    [       24.41 GB]
  /dev/hdc4    [       24.41 GB]
  1 disk
  4 partitions
  0 LVM physical volume whole disks
  2 LVM physical volumes
Related Post