ggRock Expand your root logical volume

 

Some users set their root LVM to smaller sizes (16G or less) when configuring Debian for their ggRock Server. This risks the root LVM being filled by a large generation of logs due to the server's ggRock array nearing capacity. Expanding the size of your root LVM to avoid or delay this from happening can provide enough time to resolve the cause of your ggRock array.

STEP 1 - View usage of file system

Use the following command to verify the path, size, and utilization of your root LVM:

df -h /home/

Example output should look similar to this:

root@ggrock:~# df -h /home/
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ggrock--vg-root   15G  3.7G   11G  27% /

Our root LVM path is /dev/mapper/ggrock--vg-root , it's current size is 15G, and it is already 27% full.

STEP 2 - Check volume group free space

Now we need to how much free space is available in our volume group by running:

vgdisplay  ggrock-vg

Example output:

root@ggrock:~# vgdisplay  ggrock-vg
  --- Volume group ---
  VG Name               ggrock-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               223.44 GiB
  PE Size               4.00 MiB
  Total PE              57201
  Alloc PE / Size       4767 / 18.62 GiB
  Free  PE / Size       52434 / 204.82 GiB
  VG UUID               xERnOf-6ps3-YePv-5jNm-p56M-WBtu-UzjVQQ

The "Free PE/Size" line shows us we have roughly 200G available free space.

STEP 3 - Increase your root LVM capacity

Using lvextend command and the parameter -L with this command to specify the size we want to increase the capacity to. This parameter is case-sensitive. For this example we are only increasing the capacity by 2G.

Your command should be similar to this. Where +2G is the size you wish to increase by, you can change the G to an M if you wish to only increase by megabytes.

lvextend -L +2G /dev/mapper/ggrock--vg-root -r

Example output:

root@ggrock:~# lvextend -L +2G /dev/mapper/ggrock--vg-root
  Size of logical volume ggrock-vg/root changed from <14.90 GiB (3814 extents) to <16.90 GiB (4326 extents).
  Logical volume ggrock-vg/root successfully resized.
resize2fs 1.46.2 (28-Feb-2021)
Filesystem at /dev/mapper/ggrock--vg-root is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 3
The filesystem on /dev/mapper/ggrock--vg-root is now 4429824 (4k) blocks long.

STEP 4 - Verify capacity increase

Run the following command to compare against your initial entering of this command:

df -h /home/

Expected output:

root@ggrock:~# df -h /home/
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ggrock--vg-root   17G  3.7G   12G  24% /


You can see the Size column now shows 17G instead of 15G. Verifying our increase of 2G was successful.