GCE persistent disks are the foundation of storage on Google Compute Engine. Every VM you run stores its operating system on a persistent disk, and any data worth keeping — databases, application files, logs, media — should live on additional persistent disks backed up with snapshots. This guide walks you through creating, attaching, formatting, and snapshotting GCE persistent disks, plus how to resize them and restore from backup when disaster strikes. This article covers GCE Persistent Disks and Snapshots in detail.

Prerequisites – GCE Persistent Disks and Snapshots
- A Google Cloud project with the Compute Engine API enabled and billing activated.
- The
gcloudCLI installed and authenticated (gcloud auth loginandgcloud config set project PROJECT_ID), or access to Cloud Shell. - A running GCE VM (Debian 11/12 or Ubuntu 22.04/24.04 examples used here) in the same zone where you will create the disk.
- Basic familiarity with Linux disk commands such as
lsblk,mkfs.ext4, and editing/etc/fstab.
GCE Persistent Disks: Zonal vs Regional – GCE Persistent Disks and Snapshots
Before creating anything, understand the two durability models. Zonal GCE persistent disks store their data synchronously within a single zone; they are the default, the cheapest, and perfectly fine for most workloads, provided you back them up with snapshots. Regional persistent disks replicate data synchronously between two zones in the same region, which protects against a full zone outage and is commonly used for highly available databases. Regional disks cost roughly twice as much per gigabyte-month as zonal disks, and they can only be attached to VMs in either of their two replica zones. Choosing between zonal and regional GCE persistent disks is ultimately a durability-versus-cost decision: for a standard backup workflow, zonal disks plus scheduled snapshots are the economical and well-tested choice.
Disk types also matter: pd-standard (spinning HDD, cheapest), pd-balanced (a good default SSD), pd-ssd (higher IOPS), and pd-extreme (very high IOPS, attachable only to certain machine types). Performance scales with disk size, so buying a larger disk is sometimes cheaper than buying a faster type.
Step 1: Create and Attach an Additional GCE Persistent Disk
Never store important data on the boot disk alone. Create a separate data disk in the same zone as your VM:
gcloud compute disks create data-disk \
--size=100GB \
--type=pd-balanced \
--zone=us-central1-a \
--description="Data disk for application files"
Attach it to the running VM with the attach-disk command:
gcloud compute instances attach-disk my-vm \
--disk=data-disk \
--device-name=data-disk \
--zone=us-central1-a
Attaching a disk to a running instance requires no reboot. Inside the VM, confirm the new device appeared:
lsblk
You should see a new device such as sdb. The --device-name you chose is also visible as /dev/disk/by-id/google-data-disk, which is a more stable path to use than the kernel-assigned sdb name.
Step 2: Format and Mount the GCE Persistent Disk on Linux
Format new GCE persistent disks with ext4. The discard option and zeroed lazy init flags keep formatting fast on large disks:
sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard \
/dev/disk/by-id/google-data-disk
Create a mount point and mount it:
sudo mkdir -p /mnt/disks/data-disk
sudo mount -o discard,defaults /dev/disk/by-id/google-data-disk /mnt/disks/data-disk
sudo chmod a+w /mnt/disks/data-disk
To make the mount survive reboots, add a line to /etc/fstab. First get the disk UUID:
sudo blkid /dev/disk/by-id/google-data-disk
Then append the entry (replace UUID_VALUE with the actual UUID). The nofail option is important: it lets the VM boot even if the disk is detached or unavailable, which Google recommends for all non-boot disks:
UUID=UUID_VALUE /mnt/disks/data-disk ext4 defaults,discard,nofail 0 2
Verify the fstab entry with sudo mount -a and confirm it mounted with df -h /mnt/disks/data-disk. If you automate VM provisioning, pair this with startup scripts as described in GCE Startup Scripts: Automate VM Boot Configuration.
Step 3: Create Manual Snapshots of Your GCE Persistent Disks
Snapshots are the native backup mechanism for GCE persistent disks: incremental, globally restorable within Google Cloud, and stored separately from the disk itself. Create one manually any time before a risky change:
gcloud compute snapshots create data-disk-snapshot-1 \
--source-disk=data-disk \
--source-disk-zone=us-central1-a \
--description="Before application upgrade"
List your snapshots and check their status:
gcloud compute snapshots list --filter="name:data-disk*"
Snapshots are incremental — only the blocks changed since the previous snapshot consume new storage — so frequent snapshots are cheap. You can even snapshot a disk while its VM keeps running; for the most consistent results with databases, flush and briefly pause writes (for example FLUSH TABLES WITH READ LOCK on MySQL) or use the application's own quiescing mechanism.
Step 4: Automate Backups with Snapshot Schedules
Manual snapshots are easy to forget. Snapshot schedules attach a retention and timing policy to a disk so backups happen automatically:
gcloud compute resource-policies create snapshot-schedule daily-4am \
--region=us-central1 \
--max-retention-days=14 \
--on-source-disk-delete=keep-auto-snapshots \
--daily-schedule \
--start-time=04:00
Attach the schedule to the disk:
gcloud compute disks add-resource-policies data-disk \
--zone=us-central1-a \
--resource-policies=daily-4am
This keeps 14 daily snapshots taken at 04:00, and importantly keeps the snapshots even if the source disk is deleted. For compliance-style needs you can switch --max-retention-days to an hourly schedule with longer retention, or define storage locations with --storage-location to keep snapshots in a specific multi-region.
Step 5: Restore a Disk from a Snapshot
When data is lost or corrupted, create a new disk from the snapshot. The new disk can be the same size or larger than the original:
gcloud compute disks create restored-disk \
--source-snapshot=data-disk-snapshot-1 \
--zone=us-central1-a \
--type=pd-balanced \
--size=100GB
Then attach it to a VM — the same VM (detaching the old disk first) or a fresh recovery VM — and mount it exactly as in Step 2. A common pattern is to attach the restored disk to a temporary troubleshooting VM so the production instance keeps running while you extract the files you need. Note that cross-region restores work too; you can create the restored disk in a different region, which makes snapshots a practical disaster-recovery tool, not just a backup tool.
Step 6: Resize a GCE Persistent Disk Without Downtime
GCE persistent disks can be grown while attached and in use — no reboot required. First resize the disk itself:
gcloud compute disks resize data-disk --size=200GB --zone=us-central1-a
Disks can only grow, never shrink. Then tell the guest OS to use the new space. On Ubuntu/Debian with an MBR or GPT partition layout, extend the partition first:
sudo growpart /dev/sdb 1
Then resize the filesystem (for ext4):
sudo resize2fs /dev/sdb1
Confirm with df -h /mnt/disks/data-disk — the extra 100 GB should be available immediately while your applications keep running.
Cost Notes
Understand the billing before you snapshot aggressively. Zonal persistent disks are billed per provisioned gigabyte-month (for example, balanced PD is roughly $0.10/GB-month and standard PD roughly $0.04/GB-month in US regions — check the official Compute Engine disks documentation for current regional pricing). Snapshots are billed separately per gigabyte-month of stored data (roughly $0.05/GB-month for standard snapshots, much less for archive snapshots), and because they are incremental, 14 daily snapshots cost far less than 14 full copies. Regional disks roughly double the disk cost. Watch out for two things: orphaned snapshots from deleted disks still bill you unless your schedule keeps them intentionally, and restoring a snapshot into a different region moves data across Google's network, which can incur egress charges on very large datasets.
Troubleshooting GCE Persistent Disks
- Disk attached but not visible in
lsblk: the device name may differ from what you expect. Usels -l /dev/disk/by-id/and look forgoogle-<device-name>. Detaching and re-attaching (or restarting the VM) usually resolves enumeration glitches. - VM fails to boot after editing fstab: you probably forgot
nofailon a non-boot disk entry, or there is a typo in the UUID. Boot into the serial console or detach the disk, fix the entry, and reboot. growpartreports “no change”: the partition may already span the disk (some images do this), in which case just runresize2fs. Ifgrowpartis missing, install it:sudo apt install cloud-guest-utils.- Snapshot stuck in CREATING: large, heavily-written disks take time. If it stays stuck for hours, check the operation with
gcloud compute operations listand the project quota page — snapshot storage quota exhaustion is a common culprit. - Permission denied on attach/disk operations: the IAM role needs
compute.disks.createandcompute.instances.attachDisk; the predefined Compute Instance Admin role covers both.
Conclusion
A solid workflow for GCE persistent disks is simple: keep data on dedicated zonal disks (not the boot disk), mount them reliably via UUID and nofail in fstab, protect them with automated snapshot schedules with sensible retention, and know how to restore and resize without panic. Practice the restore path once on a test VM before you need it — a backup you have never restored is only a theory. With these habits, your Compute Engine storage stays durable, recoverable, and cost-controlled.