Adding Persistent Disks to GCP VMs – Configuration & Best Practices

Gcp Kajal November 29, 2025 3 mins read

A complete guide to creating, attaching, and configuring persistent disks for Google Cloud VM instances with best practices for performance, durability, and reliability.

📘 1. Introduction

Persistent Disks in Google Cloud Platform (GCP) offer durable, high-performance block storage for your VM instances. They are perfect for applications requiring reliable data storage such as databases, application data, analytics workloads, and logs.

This guide walks you through creating, attaching, formatting, and mounting persistent disks on a GCP VM instance — whether you’re running a Linux server, web app, or database.


💿 2. Types of Persistent Disks

Before choosing a disk, it’s important to understand the different types:

🔹 pd-standard (Standard Disk)

  • Cost-effective

  • Suitable for sequential workloads

  • Good for backups, logs, and light data usage

🔹 pd-balanced (Balanced Disk)

  • Best balance between cost and performance

  • Works well for most general workloads

  • A common choice for web servers and mid-size apps

🔹 pd-ssd (SSD Persistent Disk)

  • High IOPS and low latency

  • Ideal for databases, financial apps, and high-performance servers

  • Recommended for production-grade workloads

🔹 Hyperdisk (Advanced Storage)

  • Next-generation storage

  • Ultra-low latency

  • Suitable for enterprise workloads (databases, analytics engines)


🛠 3. Step-by-Step: How to Add a Persistent Disk

Step 1: Create the Disk

  1. Open Google Cloud Console

  2. Navigate to:
    Compute Engine → Disks

  3. Click Create Disk

  4. Fill in the details:

    • Name: data-disk-1

    • Type: pd-balanced (recommended)

    • Size: e.g., 50 GB

    • Zone: Must match your VM’s zone

  5. Click Create


Step 2: Attach the Disk to the VM

  1. Go to Compute Engine → VM instances

  2. Click your VM

  3. Select Edit

  4. Scroll down to Additional Disks

  5. Click Attach Existing Disk

  6. Choose the disk created earlier

  7. Save and restart the VM (if needed)


Step 3: Format and Mount the Disk (Linux VM)

SSH into the VM:

 
sudo lsblk

Format the new disk (usually /dev/sdb):

 
sudo mkfs.ext4 /dev/sdb

Create a mount directory:

 
sudo mkdir /mnt/data-disk

Mount the disk:

 
sudo mount /dev/sdb /mnt/data-disk

Step 4: Make the Mount Permanent

Append to the /etc/fstab file:

 
echo '/dev/sdb /mnt/data-disk ext4 defaults 0 0' | sudo tee -a /etc/fstab

Your disk will now auto-mount on every boot.


4. Best Practices

Choose the right disk type

  • Standard for logs

  • SSD for databases

  • Balanced for general workloads

Use Snapshots
Create snapshots for backups and disaster recovery.

Monitor Performance
Use Cloud Monitoring to track:

  • IOPS

  • Throughput

  • Disk latency

Plan disk size wisely
Resizing a disk may require VM restart and filesystem expansion.

Separate OS and data disks
Improves performance and simplifies migrations.


🖼 5. Visual Guide (Image Suggestions)

You can enhance this blog with:

  • Screenshot of GCP Create Disk page

  • Diagram showing VM → attached disk → mount point

  • Infographic of workflow:
    Create → Attach → Format → Mount → Use → Snapshot


🏁 6. Conclusion

Persistent Disks are essential for building reliable and scalable storage in GCP.
Whether you're hosting a database, analytics system, or web server, understanding how to attach and configure disks ensures strong performance and data durability.

In the next blog, we’ll cover:
GCP Firewall Rules & SSH Access — Securing Your VM Instances

Advertisement

K
Kajal

7 posts published

Sign in to subscribe to blog updates