Google Persistent Disk & Google Filestore Services

Google Cloud Platform (GCP) provides a wide range of storage solutions, including Google Persistent Disk and Google Filestore. These services allow users to store and manage data in a reliable and scalable way. In this article, we will provide an overview of these services and explain how to use them in GCP.

Key Terminologies Before we dive into the details, let’s define some key terminologies:

Explore Free Engineering Handwritten Notes!

Looking for comprehensive study materials on Python, Data Structures and Algorithms (DSA), Object-Oriented Programming (OOPs), Java, Software Testing, and more?

We earn a commission if you make a purchase, at no additional cost to you.
  • Google Persistent Disk: A high-performance block storage service that allows users to create and attach disks to their virtual machines (VMs) in GCP.
  • Google Filestore: A fully managed file storage service that provides a shared file system for VMs running in GCP.
  • Block storage: A type of data storage that divides data into fixed-sized blocks and stores them independently.
  • File storage: A type of data storage that allows data to be stored in files and organized into directories.

Using Google Persistent Disk and Google Filestore Services

Let’s now discuss how to use Google Persistent Disk and Google Filestore in GCP.

3.1 Using Google Persistent Disk Google Persistent Disk provides block storage for VMs running in GCP. Here are the steps to create and attach a persistent disk:

Step 1: Create a new disk Navigate to the “Disks” page in the GCP Console and click “Create Disk”. Choose the disk type, size, and other relevant parameters.

Step 2: Attach the disk to a VM Navigate to the “VM Instances” page and select the VM that you want to attach the disk to. Click “Edit” and scroll down to the “Additional disks” section. Click “Add item” and select the disk that you created in step 1.

Step 3: Format and mount the disk SSH into the VM and format the disk using a filesystem of your choice. Then, mount the disk to a directory of your choice.

sudo mkfs.ext4 /dev/sdb
sudo mkdir /mnt/mydisk
sudo mount /dev/sdb /mnt/mydisk

You can now use the disk to store data and files.

3.2 Using Google Filestore Google Filestore provides file storage for VMs running in GCP. Here are the steps to create and mount a fileshare:

Step 1: Create a new fileshare Navigate to the “Filestore” page in the GCP Console and click “Create Filestore Instance”. Choose the instance type, size, and other relevant parameters.

Step 2: Mount the fileshare to a VM SSH into the VM and mount the fileshare using the mount command. Replace <fileshare-ip> with the IP address of the fileshare.

sudo mkdir /mnt/myfileshare
sudo mount -t nfs <fileshare-ip>:/myshare /mnt/myfileshare

You can now use the file share to store and access files.

There are several other topics related to Google Persistent Disk and Google Filestore that you may want to explore, including:

  • Using snapshots and backups to protect data in Google Persistent Disk
  • Creating and managing multiple fileshares in Google Filestore
  • Integrating Google Persistent Disk and Google Filestore with other GCP services, such as Kubernetes and App Engine.

Working Codes with Outputs Here’s an example of creating a new persistent disk and attaching it to a VM:

gcloud compute disks create mydisk --size=

Leave a Reply