Resizing the disk of your Ubuntu Server in Google Cloud GCP without rebooting
First Published: .
If you are running your instances in Google Gloud Compute Engine and you want to increase the size of the Disk without having to reboot, this video explains step by step how you can do it.
Go to Disks in GCP, select the disk of the instance you want to increase, then press Edit.
After you increase the Disk in Google Cloud Dashboard, then ssh to you instance.
There type:
lsblk
in order to list the devices.
In my case is sda and I want to grow the partition 1.
So I proceed with:
sudo growpart /dev/sda 1
Which growing from 30GB to 40GB produces the output:
CHANGED: partition=1 start=2324480 old: size=60590047 end=62914526 new: size=81561567 end=83886046
Is you type lsblk again you’ll see the new size.
But if you type df -h you’ll see that Linux still doesn’t see the space.
To finalize and claim the additional space execute (in my case is sda1):
sudo resize2fs /dev/sda1
Rules for writing a Comment