Increase the size of a persistent disk

Created by Shahril Ramli, Modified on Thu, 21 Aug, 2025 at 1:39 PM by Shahril Ramli

Here is a step-by-step guide for both Windows and Linux VMs.


1. Increase the Disk Size in Google Cloud Console

This step is the same for both Windows and Linux instances.

  1. Navigate to the Compute Engine menu in the Google Cloud Console.

  2. In the left-hand menu, select Disks under the Storage section.

  3. Click the name of the disk you want to resize from the list.

  4. On the disk details page, click the EDIT button.

  5. In the Size field, enter the new, larger size for your disk. You can only increase the disk size; you cannot decrease it.

  6. Click SAVE to apply the changes.

The disk's size is now increased, but the operating system on your VM can't use the new space yet. You must now extend the partition and file system. This can be done online, without stopping the VM.


2. Extend the Filesystem on the VM

The commands and procedures for this step depend on the operating system.


For Linux Instances


  1. Connect to your Linux VM instance using SSH. You can use the in-browser SSH client from the Google Cloud Console or a terminal.

  2. Use the lsblk command to view the disk and partition information. You should see that the main disk has the new, larger size, but the partition on it (e.g., sda1) is still the old size.

    • lsblk

  3. Use the growpart command to extend the partition to fill the new disk space.

    • sudo growpart /dev/sda 1

    • Note: /dev/sda is the disk name, and 1 is the partition number. Adjust these as needed if your disk or partition has a different name.

  4. Extend the filesystem to use the expanded partition. The command depends on the filesystem type (e.g., ext4 or xfs). Use df -Th to check your filesystem type.

    • For ext4: sudo resize2fs /dev/sda1

    • For xfs: sudo xfs_growfs / (for the root partition) or sudo xfs_growfs /mount/point (for a non-root partition)

  5. Verify the new size by running df -h.


For Windows Instances


  1. Connect to your Windows VM instance using RDP. You can use the RDP button in the Google Cloud Console or a standard RDP client.

  2. Open Disk Management. You can find this by right-clicking the Start button and selecting Disk Management.

  3. Right-click on the disk you resized (it may show unallocated space at the end) and select Extend Volume....

  4. Follow the Extend Volume Wizard to extend the partition to include the unallocated space.

  5. Complete the wizard. The new space will now be part of the volume and accessible to the operating system.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article