Increase the Storage of a VM in Google Cloud Platform (GCP)
This way helps to increase the VM disk size without STOP.
Resize the Persistent Disk
- Go to the Google Cloud Console.
- Navigate to Compute Engine → VM instances.
- Click on the VM instance where the disk is attached.
- Scroll down to the Boot disk and additional disks section.
- Click on the disk name you want to resize.
- Click Edit.
- Increase the size (e.g., from 50GB to 100GB).
- Click Save.
After resizing the disk in GCP, run the following commands inside your VM:
Check the disk size by lsblk
Resize the filesystem:
If using ext4 : sudo resize2fs /dev/sdb1
If using XFS : sudo xfs_growfs /mnt/disk
(replace with the actual disk mount directory)