How to Scan Disk for Physical Volume in LVM

Posted on

LVM or Logical Volume Management is a system for managing logical volumes which is far more advanced compared to the traditional method of disk partitioning. It is also considered as a flexible method for managing disk than the traditional method where the features of this mechanism allows to allocate disk into one or more segments or partitions and it also permits those partition to be formatted with a specific filesystem.

Basically, there are three types of volumes managed by LVM where one of the volume type is called the physical volume. This kind of volume is also the first volume created before the other two types of volumes can be made. The physical volume existence can be scanned through the entire disk or storage which is attached to the server. There are command specific for scanning the existence of the physical volume through those entire disk mentioned before which is already becoming part of which is recognized by the operating system installed in the server. The command in shown below :

pvscan

Below is the actual command executed with the output generated by executing the command :

[root@hostname ~]# pvscan
  PV /dev/sda2   VG centos   lvm2 [49,51 GiB / 0    free]
  Total: 1 [49,51 GiB] / in use: 1 [49,51 GiB] / in no VG: 0 [0   ]
[root@hostname ~]#

As shown in the above output generated, there is a physical volume which is represented with the label of ‘PV’ in the disk called /dev/sda2. The PV or the physical volume has no volume group because it hasn’t been initiated. That is actually the two types of volume managed by LVM which is the volume group and the logical volume. So, the next step for utilizing the disk is by creating a volume group in the physical volume. The next step is creating the volume group and then further more creating a logical volume. After creating the logical volume, just format that volume with the suitable filesystem chosen.

One thought on “How to Scan Disk for Physical Volume in LVM

Leave a Reply