GoogleCloudPlatform / gcsfuse

A user-space file system for interacting with Google Cloud Storage

Home Page:https://cloud.google.com/storage/docs/gcs-fuse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to make gcsfuse mount persistent in GCP Linux RHEL VM

NoorMozzam opened this issue · comments

Currently I have mounted a GCP Bucket on a GCP RHEL VM [7.8] using Linux command for mount using Default VM service account.

mount -t gcsfuse -o rw,allow_other,implicit_dirs,dir_mode=775,gid=1234 ABC-GCPBUCKET XYZ-MOUNTLOCATION

Please guide me on how I can make this mount persistent, I know I can add an entry in fstab. Rhe problem that I faced with it earlier is during a reboot, when service account is getting dettached from the VM, this mount doesn't come back and also disrupts the boot process.

Please share the available ways to make this mount entry persistent on RHEL VM using default service account. Also recommend which will be best option to choose considering security and stability of environment.

@NoorMozzam thanks for reporting this issue.

I tried this on a RHEL-7 GCE VM (I did not have RHEL-7.8 VM available at the moment, but I am assuming that the behaviour should be same between 7 and 7.8), and with GCSFuse 1.4.2 (latest version). We have not fixed anything here recently, so an older version of GCSFuse should work just the same.

With the above set of flags/options, I was able to recreate the issue, i.e. I was not able to mount the bucket on reboot and was stuck at the boot itself (similar to during a reboot, when service account is getting dettached from the VM, this mount doesn't come back and also disrupts the boot process as you said). At this point, my /etc/fstab had the following entry.

<bucket-name> </path/to/mount/to> gcsfuse rw,allow_other,implicit_dirs,dir_mode=775,gid=1234

I searched in past logs, and found this issue similar to another issue, #1043 , which was resolved by adding option _netdev to the mount options (more details are available in our documentation here.). This option ensures that Cloud Storage FUSE waits for the network system to be ready prior to mounting.

For example, the entry in /etc/fstab looks like:

<bucket-name> </path/to/mount/to> gcsfuse rw,allow_other,implicit_dirs,dir_mode=775,gid=1234,_netdev

This worked for me, i.e. I was successfully able to boot the VM and also see the mounted bucket at </path/to/mount/to>.

Please try this out in your VM, and let me know whether it worked or not.

Reduced priority to P2 as customer has been provided solution and the issue is now pending customer action

Can confirm that the "_netdev" flag works on RHEL V7.8 passing boot without any issued with default OS and FUSE setup;

Hi @NoorMozzam,

Closing this issue based on the confirmation from @andreixu. Please feel free to re-open if you need further assistance.

Thanks,
Ashmeen