linux – How to add unallocated free space using shell in Centos?

I have some free space unallocated and this problem affects more instances.

Number  Start   End     Size    Type     File system  Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  1075MB  1074MB  primary  xfs          boot
 2      1075MB  34.4GB  33.3GB  primary               lvm
        34.4GB  53.7GB  19.3GB           Free Space

How can I fix this issue using shell scripting? It is impossible to do the operations using cfdisk on every instance.