0

I'm trying to configure a CentOS HA system with 2 nodes, with DRBD for replicated storage. I'm following the "Clusters from Scratch" guide, and at the DRBD portion, I need to create a partition for DRBD, and I'm running into some problems

First of all, vgdisplay shows 0 free space

  --- Volume group ---
  VG Name               centos
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.02 GiB
  PE Size               4.00 MiB
  Total PE              238341
  Alloc PE / Size       238341 / 931.02 GiB
  Free  PE / Size       0 / 0   
  VG UUID               c2Vgsy-6GNs-f3sq-rkA9-tPVq-7ie8-ElyJeC

Hence, when I try to do a lvcreate, I get the error message "Volume group "centos" has insufficient free space (0 extents): 256 required."

My CentOS 7 installation is with GUI, and df shows the following:

Filesystem              1K-blocks    Used Available Use% Mounted on
/dev/mapper/centos-root  52403200 7587668  44815532  15% /
devtmpfs                 12196412       0  12196412   0% /dev
tmpfs                    12205536   54800  12150736   1% /dev/shm
tmpfs                    12205536   25532  12180004   1% /run
tmpfs                    12205536       0  12205536   0% /sys/fs/cgroup
/dev/sda1                  505580  204620    300960  41% /boot
/dev/mapper/centos-home 911041916  576192 910465724   1% /home
/dev/sdb1                 7815240 3310764   4504476  43% /run/media/root/0935-41EE

There's plenty of space being used by /dev/mapper/centos-home. How do I carve out some space to create a new partition?

Thanks.

1 Answer 1

0

Your Volume Group does indeed have 0 free space since it's already allocated to the existing logical volumes. If you execute lvdisplay, you'll see the distribution on the various partitions (this should match what you're seeing in df).

You can free up space in the Volume Group by reducing the /dev/mapper/centos-home partition, but most partitions are hard to reduce.

I would advise the following steps:

  1. Copy all data from your /home partition to your root partition
  2. Remove the /home partition, and recreate it, but a lot smaller
  3. Move the previous data from your root partition back to your /home partition
  4. Create the new logical volume

Kind regards

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .