Learn how to create and mount a persistent disk in GCP with this step-by-step guide. Take a minute to read what our Google Cloud Support Team has to say.
How to Create and Mount a Persistent Disk in GCP: A Step-by-Step Guide
Google Persistent Disk is a powerful block storage solution offered by Google Cloud Platform. It is designed to provide reliable, high-performance storage for virtual machine instances. Persistent Disk offers the durability and flexibility to meet our storage needs, whether we need to store critical application data or run demanding workloads.
Today, we will we will explore what Google Persistent Disk is, its key features, different disk types, and a step-by-step guide to creating and mounting persistent disks on GCP.
An Overview:
What Makes Google Persistent Disk Stand Out?
Persistent Disk is a block-level storage that we can attach to our VM instances in GCP. Unlike ephemeral disks, which lose data when an instance stops or restarts, Persistent Disk retains the data independently from the lifecycle of our VM.
Key Features of Google Persistent Disk
- Persistent Disk replicates our data within the same zone, protecting it from hardware failures and ensuring data integrity.
- Easily scale the storage by resizing disks on the fly or attaching multiple disks to a single VM instance without downtime.
- Choose from Standard Persistent Disks (HDD) for cost-effective storage or SSD Persistent Disks for high IOPS and low latency.
- Create incremental snapshots to efficiently back up the data, minimize storage costs, and support disaster recovery or cloning use cases.
- Persistent Disk works smoothly with Compute Engine, Google Kubernetes Engine (GKE), and other Google Cloud services.
- Transparent pricing based on disk type, size, and usage helps you optimize your storage expenses.
- All data stored in Persistent Disk is automatically encrypted both in transit and at rest, using either customer-supplied or Google-managed encryption keys.
Types of Google Persistent Disks
Let’s look at the different types of Persistent Disk offered by Google Cloud:
- Standard Persistent Disks (HDD):
Economical and suitable for large, sequential workloads.
- SSD Persistent Disks:
High-performance SSD storage for latency-sensitive and I/O-intensive applications.
- Local SSDs:
Physically attached to the VM host for ultra-low latency but non-persistent storage.
- Zonal Persistent Disks:
Available within a single zone.
- Regional Persistent Disks:
Replicated across two zones for higher availability.
- Snapshot-Based Disks:
Created from snapshots to replicate or back up existing disk states.
Create and Mount a Google Persistent Disk
Step 1. Create a Persistent Disk
- Go to the GCP Console and navigate to Compute Engine > Disks.
- Click Create to start a new disk.
- Enter the disk name, size, and choose the disk type (Standard HDD or SSD).
- Select the region and zone for the disk.
- Click Create.
Step 2. Create a VM Instance
- In the GCP Console, navigate to Compute Engine > VM instances.
- Click Create to launch a new instance.
- Set the instance name, region, zone, machine type, and boot disk details.
- Click Create.
Step 3. Attach the Persistent Disk to the VM
- Now, go to Compute Engine > Disks.
- Select the persistent disk we created.
- Click Create attachment.
- Choose your VM instance from the dropdown.
- Assign a device name for the disk.
- Click Create.
Step 4. Mount the Persistent Disk on the VM
- SSH into the VM instance from the GCP Console.
- Run `ls /dev/disk/by-id/` to identify the attached disk.
- Create a mount point directory:
sudo mkdir /mnt/my-disk
- Mount the disk to the directory:
sudo mount /dev/sdb1 /mnt/my-disk
Now, the persistent disk is ready to use on our VM.
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
Google Persistent Disk offers a reliable, scalable, and high-performance storage solution for Google Cloud workloads.
Google Persistent Disk helps us manage and protect our data effectively in the cloud, whether we are running a simple web app or complex containerized workloads.
In brief, our Support Experts demonstrated how to create and mount a persistent disk in GCP with this step-by-step guide.
0 Comments