📘 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
-
Open Google Cloud Console
-
Navigate to:
Compute Engine → Disks -
Click Create Disk
-
Fill in the details:
-
Name:
data-disk-1 -
Type:
pd-balanced(recommended) -
Size: e.g.,
50 GB -
Zone: Must match your VM’s zone
-
-
Click Create
Step 2: Attach the Disk to the VM
-
Go to Compute Engine → VM instances
-
Click your VM
-
Select Edit
-
Scroll down to Additional Disks
-
Click Attach Existing Disk
-
Choose the disk created earlier
-
Save and restart the VM (if needed)
Step 3: Format and Mount the Disk (Linux VM)
SSH into the VM:
Format the new disk (usually /dev/sdb):
Create a mount directory:
Mount the disk:
Step 4: Make the Mount Permanent
Append to the /etc/fstab file:
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
FAQs (0)
Sign in to ask a question. You can read FAQs without logging in.