Modify the size of a Persistent Disk

If your Compute Engine virtual machine (VM) instance needs additional storage space or increased performance limits, you can increase the size of your Persistent Disk. You can increase the disk size at any time, whether or not the disk is attached to a running VM.

This page discusses how to change the size of a Persistent Disk. To increase the size of a Google Cloud Hyperdisk volume, see Modify the size and provisioned performance of a Hyperdisk volume.

When you create a custom Linux image, custom Windows image, or a Fedora CoreOS image, you need to manually increase the size of the boot and non-boot disks. If you're using a public image (except for Fedora CoreOS images), Compute Engine automatically resizes the boot disks.

Increasing the size of a disk doesn't delete or modify disk data, but as a best practice, before you make any changes to the file system or partitions, always back up your disk by creating a snapshot.

Compute Engine manages the hardware behind Persistent Disks, so that you can add and resize your disks without handling striping or redundancy.

Before you begin

  • If you haven't already, set up authentication. 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

    1. Install the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:

      gcloud init

      If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

    2. 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.

    1. 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.

  • If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    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.