[Automation Suite][Maintenance] Expand /datadisk in offline environments

How to expand /datadisk in offline environments ?


ISSUE

Once the /datadisk filesystem becomes full, there is a requirement to increase disk space.

RESOLUTION

  1. Identify the VG name and LV name for /datadisk filesystem. Run the following command to verify disk name, VG name & LV name:

~~~~~~~~~~~~~~~~~~

# df -h /datadisk

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/uipathdatavg-longhornlv 1.0T 46G 978G 5% /datadisk

~~~~~~~~~~~~~~~~~~

For the above output, VG name is uipathdatavg & LV name is longhornlv

  1. Validate whether there is available free space in the VG that can be added to /datadisk:

~~~~~~~~~~~~~~~~~~

# vgs uipathdatavg

VG #PV #LV #SN Attr VSize VFree

uipathdatavg 1 1 0 wz--n- <1024.00g 0

~~~~~~~~~~~~~~~~~~

The VFree output indicates whether any space is available. In the above output, it shows that there is no available space.

  1. If there is available space in VFree, one can expand disk space by executing the command specified in step 9. If not, proceed to the next steps.
  1. Customers need to request their infrastructure team to allocate the new disk on the server.
  1. Once the disk is allocated to the server, it should be visible in the following output:

~~~~~~~~~~~~~~~~~~

# fdisk -l

~~~~~~~~~~~~~~~~~~

Identify the new disk and consider it as /dev/sdh for this example.

  1. Identify the disk from the previous output and create a PV out of it. For the new disk identified as /dev/sdh, run the following command:

~~~~~~~~~~~~~~~~~~
# pvcreate /dev/sdh
~~~~~~~~~~~~~~~~~~

  1. Expand the VG uipathdatavg with a new disk

~~~~~~~~~~~~~~~~~~

# vgextend uipathdatavg /dev/sdh

~~~~~~~~~~~~~~~~~~

  1. Verify that VG uipathdatavg has free space available to expand /datadisk

~~~~~~~~~~~~~~~~~~

# vgs uipathdatavg

VG #PV #LV #SN Attr VSize VFree

uipathdatavg 1 1 0 wz--n- <1024.00g 5G

~~~~~~~~~~~~~~~~~~

  1. Expand the LV longhornlv with the following command:

~~~~~~~~~~~~~~~~~~

# lvextend -r -L+ /dev/mapper/uipathdatavg-longhornlv

~~~~~~~~~~~~~~~~~~

For 5G to expand, run the following command:-

~~~~~~~~~~~~~~~~~~

# lvextend -r -L+5G /dev/mapper/uipathdatavg-longhornlv

~~~~~~~~~~~~~~~~~~

  1. The /datadisk will reflect new size.

~~~~~~~~~~~~~~~~~~

# df -h /datadisk

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/uipathdatavg-longhornlv 1.0T 46G 983G 5% /datadisk