Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mounting google storage bucket folder using gcsfuse

Tags:

gcsfuse

I am not able to mount a specific folder inside the google storage bucket

On OS X, this program allows you to mount buckets using the mount command. (On Linux, only root can do this.)

mount -t gcsfuse -o rw,user my-bucket /path/to/mount/point

On both OS X and Linux, you can also add entries to your /etc/fstab file like the following:

my-bucket /mount/point gcsfuse rw,noauto,user

Can somebody help me?

my-bucket:foldername /mount/point gcsfuse rw,noauto,user

This doesn't work for me

like image 482
user28763 Avatar asked Dec 21 '15 07:12

user28763


People also ask

How do I mount a GCP bucket inside a container?

To mount the GCP bucket inside the container, run the container in privileged mode. For a container to start the deployment the file should contain required configuration with a Google Cloud Storage bucket mounted in a given path.

How do I upload a directory bucket to GCP?

In the Google Cloud console, go to the Cloud Storage Buckets page. Navigate to the bucket. Click on Create folder to create an empty new folder, or Upload folder to upload an existing folder.


1 Answers

Mounting a specific directory within a bucket isn't supported for use with mount and fstab, but if you run the gcsfuse command directly you can do this with the flag --only-dir:

gcsfuse --only-dir foldername/ my-bucket /mount/point
like image 187
jacobsa Avatar answered Jan 04 '23 02:01

jacobsa