Last active
May 19, 2023 12:44
-
-
Save clivewalkden/831d7723d482eb9df16eda1f1a9dee5c to your computer and use it in GitHub Desktop.
Google Cloud Resize a disk (CentOS & Ubuntu)
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
# Before this is run you need to change the disk size on the cloud (or via cli) | |
# Get the partition and device information | |
df -h | |
# Get the block size of the device and any partitions | |
sudo lsblk | |
# Make sure you have the tools to resize a drive | |
sudo yum -y install cloud-utils-growpart | |
# Grow the device id and partion id (in this case sda1) | |
sudo growpart /dev/sda 1 | |
# Resize the mounted partition in this case /dev/sda1 mounts to / | |
sudo xfs_growfs / | |
# Check it has all worked | |
df -h |
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
# Before this is run you need to change the disk size on the cloud (or via cli) | |
# Get the partition and device information | |
df -h | |
# Get the block size of the device and any partitions | |
sudo lsblk | |
# Grow the device id and partion id (in this case sda1) | |
sudo growpart /dev/sda 1 | |
# Resize the mounted partition in this case /dev/sda1 mounts to / | |
sudo resize2fs /dev/sda1 | |
# Check it has all worked | |
df -h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment