Increase the size of the /dev/mapper/centos_centos7-root

By | October 10, 2019

From our monitoring we received a disk full alert for our configuration backup server, which is a CentOS VM.

Nagios XI Alert
This is an escalated notification
Type: PROBLEM
Servicecheck:/ Disk Usage
Hostname: *CentOS_Server*
State: WARNING
service_output:
/: 95%used(25740MB/27091MB) (95%) : WARNING
service_long_output:

So we needed to increase the size of this volume. In our case the volume /dev/mapper/centos_centos7-root was on a physical disk with that has a total capacity of 60GB. A mere 26Gb was in use so there was more then 30GB of free space to be allocated:

The file system sits on top while the physical disk is the first tier if you will.
4. File system
3. Logical Volumes
2. Logical Volume group
1. Physical disk

volume group display (vgdisplay) to see the size of the volume groups

Do a lvdisplay to list the size of the logical volumes, important is the root partition. You can see that the size is a mere 26GB (other lv’s on the list is filtered out)

Do a pvdisplay to list the size of the physical volume, in our case /dev/sda2 needs te be extended

Extend the partition

Now extend the volume with 10GB

Resize the file system

/dev/mapper/centos_centos7-root is increased with 10GB to 37GB

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.