Last active
February 1, 2021 08:24
-
-
Save xelwarto/6f5c6556613c9215b1e1 to your computer and use it in GitHub Desktop.
Expanding (resize) Centos 7 (or Red Hat EL 7) root partition in Custom Google Compute Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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