Linux VPS Allocate storage using script
This script was tested on CentOS 6, you may need to change the size and path/volume names.
Create empty file
# touch lvmscript.sh
Open in Editor and copy/paste the script from "Start-End"
# vim lvmscript.sh
############################START
#!/bin/bash
# pvcreate Create physical volume
pvcreate /dev/sdb
# Extend volume group
vgextend VolGroup /dev/sdb
# Extend Logical Volume
lvextend -L+19G /dev/VolGroup/LogVol01
# resize Logical Volume
resize2fs /dev/VolGroup/LogVol01
# resize Logical Volume using xfs
# xfs_growfs /dev/VolGroup/LogVol01
############################END
Rights for execute
# chmod +x lvmscript.sh
Execute script
# ./lvmscript.sh
# URL https://www.youtube.com/watch?v=vk_mxIxkJVI