Mount Filestore on Compute Engine clients
Mounting Filestore on Compute Engine clients in Google Cloud Platform (GCP) allows users to access and utilize file shares hosted on Filestore instances from within their virtual machine (VM) instances. This capability enables seamless collaboration and data sharing across VM instances, facilitating efficient workflows and data-driven applications.
Prerequisites
GCP account
Open Console
Open Menu > Compute Engine > VM Instances
NB : The Instance should be created in the VPC network
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-3.png)
Click on SSH of the Instance
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-4.png)
Use the following commands to install NFS on Debian or Ubuntu
$ sudo apt-get -y update &&
$ sudo apt-get install nfs-common
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-5.png)
Make a local directory to map to the file share:
$ sudo mkdir -p <mount-point-directory>
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-6.png)
Open the Filestore instance
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-7.png)
Copy the NFS Mount Point.
It is to mount the fileshare on a Client VM
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-8.png)
Mount the file share from the Filestore instance
$ sudo mount <ip-address:/file-share> <mount-point-directory>
Change ip-address:/file-share and paste the NFS Mount Point of your instance
Give your mount point directory of yours
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-9.png)
Confirm that the Filestore file share is mounted:
$ df -h --type=nfs
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-10.png)
Creating and mounting subdirectories on the file share
To create a subdirectory on the mounted file share
$ sudo mkdir -p mount-point-directory/file-share-sub-dir
Mount the subdirectory:
$ sudo mount ip-address:/file-share/file-share-sub-dir mount-point-directory/sub-dir
Confirm that the Filestore file share is mounted:
$ df -h --type=nfs
![](https://prwatech.in/blog/wp-content/uploads/2021/06/image-11.png)
Mount Filestore on Compute Engine clients