Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Expanding (resize) Centos 7 (or Red Hat EL 7) root partition in Custom Google Compute Image
# Requires cloud-utils-growpart to be installed
# Resize ROOT FS
part=`df --output=source / |grep "/dev/"`
if [ ! -z "$part" ] ; then
len=${#part}
p=`echo $part|cut -c$len`
d=`echo $part|cut -c1-$(($len-1))`
growpart "$d" "$p"
xfs_growfs "$part"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.