Computing: Computer Administration

Adding an LVM PV on Centos 7.

When you install CentOS 7, choosing automatic partitioning, as shown on the screenshot below, the installer will not create a classic disk storage layout using partitions. By default, CentOS 7 uses the logical volume manager (LVM), that allows to create logical volumes out of one or multiple physical harddisks. LVM volumes can be created on both software RAID partitions and standard partitions. Such volumes can be extended, giving greater flexibility to systems as requirements change. This tutorial shows, how to add a second harddisk to the existing LVM disk storage layout. For details about LVM and the definitions of physical volume (PV), volume group (VG) and logical volume (LV), please have a look at the first paragraphs of my Using LVM disk storage layout on Ubuntu Server tutorial.

Centos 7 installation: Default partitioning will result in the creation of an LVM disk storage layout

In fact, it was a lucky situation for me, that CentOS uses LVM by default. I had configured my VMware virtual machine with one 50 GB harddisk, that would normally be largely enough. However, when I tried to install OnlyOffice, the installer refused to setup the application, because the minimum storage capacity requirement wasn't fulfilled. I added a second harddisk (25 GB) to the VM and asked myself where I could mount this disk in order to make the supplementary storage available to the system and to OnlyOffice in an optimal way. CentOS 7 doesn't include gParted, as do most Linux distributions, but has GNOME Disks, a disk management utility for GNOME. When I used this application to have a look at the storage layout on the first harddisk (screenshot), I realized that there were two partitions: a 1.1 GB EFI partition, needed for UEFI boot (/dev/sda1) and a 53 GB partition of type Linux LVM (the 50 gigabyte harddisk corresponds in fact to a disk of 50 GiB, what's the same than 54 GB). No more need to worry about mount points: Just adding the disk as a second PV to the existing LVM.

GNOME Disks: Display of the hard disk storage layout with EFI and LVM partition

There are some useful utilities to view information about LVM: pvdisplay shows information about physical volumes; vgdisplay shows information about volume groups and lvdisplay shows information about logical volumes. On the screenshots below, we can see