Creating a Volume Group

Before we get into the details of creating a volume group its best we know more about physical volumes, since physical volumes are the foundation to building a volume group.

Using fdisk you should be able to list available partitions and disks on your server. Lets assume you have 3 disks:

  • /dev/sda
  • /dev/sdb
  • /dev/sdc

Lets assume /dev/sda has already been divided into partitions like so

/dev/sda1 -> /root /dev/sda2 -> /swap /dev/sda3 -> /boot

So we have only 2 free disks /dev/sdb and /dev/sdc, we can use these non-partitioned disks to create a Physical Volume.

Bash
Copy

Now by running pvscancommand we can get a list of available physical volumes or you can get a more detailed information from pvdisplaycommand.

Bash
Copy

Now that we have 2 physical volumes we can create a volume group in the following format

Bash
Copy

When physical volumes are used to create a volume group, its disk space is divided into 4MB extents, by default. This extent is the minimum amount by which the logical volume may be increased or decreased in size. Large numbers of extents will have no impact on I/O performance of the logical volume.

For KVM its recommended that we use 128M extents by using the -s option while creating the volume group

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated by Bharat Bala