Increase the size of a persistent disk Stay organized with collections Save and categorize content based on your preferences.
You can increase the size of your Persistent Disk when your virtual machine (VM)instance requires additional storage space orincreased performance limits.You can increase the disk size at any time, whether or not the disk is attachedto a running VM.
This page discusses how to increase the size of a Persistent Disk. To increase thesize of a Google Cloud Hyperdisk volume, seeModify the settings of a Hyperdisk.
You can only increase, and not decrease, the size of a disk. To decrease thedisk size, you must create a new disk with a smaller size. Until you delete theoriginal, larger disk, you are charged for both disks.
When youcreate a custom Linux image orcustom Windows image,you need to manually increase the size of the boot and non-boot disks. If you'reusing apublic image, Compute Engineautomatically resizes the boot disks.
Increasing the size of a disk doesn't delete or modify disk data, but as a bestpractice, before you make any changes to the file system or partitions, alwaysback up your disk by creating a snapshot.
Compute Engine manages the hardware behind persistent disks, so thatyou can add and resize your disks without handling striping or redundancy.
Important: Public Google Cloud Images don't use MBR partition typesand can only haveGPT partition types. Imported Disks withMBR partition type can only be increased to 2 TB.partitions beyond 2 TB or changing the partition type from MBR to GPT isn'tsupported. Images with MBR partitions are not supported by Cloud Customer Care.Before you begin
- If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- Set a default region and zone.
Terraform
To use the Terraform samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.If you're using a local shell, then create local authentication credentials for your user account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
Required roles and permissions
To get the permission that you need to resize a Persistent Disk, ask your administrator to grant you the following IAM roles on the project:
- Compute Instance Admin (v1) (
roles/compute.instanceAdmin.v1) - To connect to a VM that can run as a service account:Service Account User (v1) (
roles/iam.serviceAccountUser)
For more information about granting roles, seeManage access to projects, folders, and organizations.
This predefined role contains the compute.disks.update permission, which is required to resize a Persistent Disk.
You might also be able to get this permission withcustom roles or otherpredefined roles.
Increase the size of a disk
To increase the size of a boot or non-boot disk, use the following procedures:
Note: You can resize an Extreme Persistent Disk only once in a 6 hour period.Console
In the Google Cloud console, go to theDisks page.
In the list of persistent disks in your project, click the name of thedisk that you want to resize.
On the disk details page, clickEdit. You might need toclick theMore actions menu and thenEdit.
In theSize field, enter the new size for your disk. Disks with MBRpartition tables can only resize up to 2 TB.
ClickSave to apply your changes to the disk.
The new disk size is displayed in the list of disks.
gcloud
Use thegcloud compute disks resizecommandand specify the--size flag with the new disk size, in gibibytes (GiB).
gcloud compute disks resizeDISK_NAME \ --sizeDISK_SIZE \ --zone=ZONE
Replace the following:
DISK_NAME: the name of the disk that you areresizing.DISK_SIZE: the new size, in gibibytes (GiB), forthe disk. Disks with MBR partition tables can resize only up to2 TB.ZONE: For zonal Persistent Disk, specify thezone where the disk is located.For Regional Persistent Disk, use instead the
--region=REGIONflag and specify the region where theregional disk is located.
Terraform
Choose one of the following options to resize either zonal disks orRegional Persistent Disk:
Zonal disk
To change the size of a Persistent Disk, you can use thegoogle_compute_disk resource and use thesize parameter.
# Using pd-standard because it's the default for Compute Engineresource "google_compute_disk" "default" { name = "disk-data" type = "pd-standard" zone = "us-west1-a" size = "5"}If you include thesize parameter along with theimage orsnapshot parameter, thesize value must be equal to or greater than the size of the image or snapshot.
If you omit theimage andsnapshot parameters, you can set thesize parameter to less than the existing disk size. If you do this, Terraform destroys the disk and creates a new empty Persistent Disk.
Caution: To prevent Terraform from destroying and re-creating a disk, you can add thelifecycle.prevent_destroy = true setting to the Terraform configuration.
During the re-creation, Terraform doesn't copy over other data that isn't also included in the Terraform configuration, such as labels or snapshot schedules.
Regional Persistent Disk
To change the size of a Regional Persistent Disk, you can use thegoogle_compute_region_disk resource and use thesize parameter.
resource "google_compute_region_disk" "regiondisk" { name = "region-disk-name" snapshot = google_compute_snapshot.snapdisk.id type = "pd-ssd" region = "us-central1" physical_block_size_bytes = 4096 size = 11 replica_zones = ["us-central1-a", "us-central1-f"]}If you include thesize parameter along with theimage orsnapshot parameter, thesize value must be equal to or greater than the size of the image or snapshot.
If you omit theimage andsnapshot parameters, you can set thesize parameter to less than the existing disk size. If you do this, Terraform destroys the disk and creates a new empty RegionalPersistent Disk.
Caution: To prevent Terraform from destroying and re-creating a disk, you can add thelifecycle.prevent_destroy = true setting to the Terraform configuration.
During the re-creation, Terraform doesn't copy over other data that isn't also included in the Terraform configuration, such as labels or snapshot schedules.
REST
To resize a Persistent Disk, construct aPOST request to thecompute.disks.resize method.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME/resize{ "sizeGb": "DISK_SIZE"}To resize a Regional Persistent Disk, construct aPOST request to thecompute.regionDisks.resize method.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/disks/DISK_NAME/resize{ "sizeGb": "DISK_SIZE"}Replace the following:
PROJECT_ID: your project ID.ZONE: For zonal Persistent Disk: the zone where thedisk is located.REGION: For Regional Persistent Disk: the regionwhere the disk is located.DISK_NAME: the name of the disk to resize.DISK_SIZE: the new size, in gibibytes (GiB), forthe disk. Disks with MBR partition tables can resize only up to 2 TB.
Resize the file system and partitions
After increasing the size of a disk, you might need to resize its file systemand partitions. The following list shows additional information for boot andnon-boot disks:
Boot disk: If you are usinga custom Linux imageor acustom Windows image,you must manually resize the root partition and file system. For VMs withpublic images, Compute Engine automaticallyresizes the root partition and file system after you increase the size of theboot disk and restart the VM.
Non-boot disk: After increasing the size of the disk, you must extend thefile system on the disk to use the added space.
The following example shows how to manually resize the root partition and filesystem of a boot disk, and how to manually resize the file system of a non-bootdata disk with no partition table. This example assumes that the diskis attached using SCSI and was previously formatted and mounted.
If your Persistent Disk was attached using NVMe, seeResize the file system and partitionsfor example output for NVMe-attached disks.
Linux VMs
In the Google Cloud console, go to theVM instances page.
Next to the instance that has the new attached disk, click theSSHbutton. The browser opens a terminal connection to the instance.
Use the
dfand thelsblkcommands to list the size of the file systemand to find the device names for your disks.$sudo df -ThFilesystem Type Size Used Avail Use% Mounted on/dev/sda1 ext4 9.7G 1.2G 8.5G 12% //dev/sdb ext4 250G 60M 250G 1% /mnt/disks/disk-1
$sudo lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 20G 0 disk└─sda1 8:1 0 10G 0 part /sdb 8:16 0 500G 0 disk /mnt/disks/disk-1
This example includes the following disks:
- Boot disk: The
/dev/sda1partition is on a boot disk that hasbeen resized to 20 GB. The partition table and the file system provideonly 9.7 GB to the operating system. - Non-boot data disk: The
/dev/sdbnon-boot data disk has nopartition table, but the file system on that disk provides only 250 GBto the operating system. The mount directory for this disk is/mnt/disks/disk-1.
The
dfcommand shows that the/dev/sda1partition is mounted as theroot file system, and the/dev/sdbdisk is mounted as a non-boot datadisk at/mnt/disks/disk-1. Make note of theType column, whichindicates if your disk uses anext4orxfsfile system.- Boot disk: The
Verify the partition type:
Alternatively, to see information only for a specific disk:sudo parted -l
Look for the fieldPartition Table. If the value issudo parted -l /dev/DEVICE_NAME
msdos, thenthe disk has an MBR partition type. This means the maximum size of such adisk is 2 TB.Resize the root partition and file system on the boot disk. This exampleassumes the VM image does not support automatic root partitioning andfile system resizing.
Resize the root partition by using
parted. For example, thefollowing commands expand partition1of/dev/sdato the maximumpossible size:Open
partedon the/dev/sdapartition:sudo parted /dev/sda
At the
(parted)prompt, enter:resizepart
At the
Partition number?prompt, enter:1
At the
Warning: Partition /dev/sda1 is being used. Are you sureyou want to continue?prompt, enter:Yes
At the
End?prompt, enter100%
At the
(parted)prompt, enter:quit
Read the new partition table using
partprobe.sudo partprobe /dev/sda
Extend the file system:
If you are using
ext4, use theresize2fscommand:sudo resize2fs /dev/sda1
If you are using
xfs, use thexfs_growfscommand:sudo xfs_growfs -d /
If you are usingbtrfs,use the
btrfscommand:sudo btrfs filesystem resize max /
Resize the file system on the non-boot data disk.
If you are using
ext4, use theresize2fscommand to extend thefile system:sudo resize2fs /dev/DEVICE_NAME
Replace
DEVICE_NAMEwith the device name forthe disk. In this example, the device name is/dev/sdb.If you are using
xfs, use thexfs_growfscommand to extend thefile system:sudo xfs_growfsMOUNT_DIR
ReplaceMOUNT_DIR with the mount point of the device. Youcan find the mount point listed in the
MOUNTPOINTcolumn in theoutput of thelsblkcommand.If you are usingbtrfs,use the
btrfscommand to extend the file system:sudo btrfs filesystem resize maxMOUNT_DIR
ReplaceMOUNT_DIR with the mount point of the device. Youcan find the mount point listed in the
MOUNTPOINTcolumn in theoutput of thelsblkcommand.
Use the
dfcommand to verify that the file system is extended. Forexample:df -h /dev/sdbFilesystem Size Used Avail Use% Mounted on/dev/sdb 493G 70M 492G 1% /mnt/disks/disk-1
Windows VMs
Use theWindows Disk Management utility to resize partitions on a Windows instance.
In the Google Cloud console, go to theVM instances page.
Next to the instance that has the resized disk, click theRDP button.The browser opens an RDP connection to the instance.
Right-click the Windows Start button and selectDisk Management toopen the Disk Management tool.

Show the disks partition type by running in Powershell:
In thePartition Style column, if the value isMBR then thedisk has an MBR partition type. This means themaximum size of such a disk would be 2 TB.Get-Disk
Refresh the Disk Management tool so that it recognizes the additionalspace on your zonal persistent disk. At the top of the Disk Managementwindow, clickAction and selectRefresh.

On the disk that you resized, right-click the formatted partition andselectExtend Volume.

Follow the instructions in theExtend Volume Wizard to extend yourexisting partition to include the extra disk space. If the existingpartition is formatted in NTFS, the maximum partition size islimited byits cluster size settings.
After you complete the wizard and the volume finishes formatting, checkthe
Statuscolumn on the list of attached disks to ensure that the newdisk has aHealthystatus.
You don't need to restart your VM after you complete this process. Youcan now use the added disk space to store data.
What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.