6

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

rebatoma
  • 734
  • 1
  • 17
  • 32
user28763
  • 111
  • 1
  • 2
  • 4
  • 1
    Where did you come up with the syntax `my-bucket:foldername`? Is that a widely used syntax for other file systems? (If so, do you mind linking to some examples?) – jacobsa Jan 13 '16 at 09:59

3 Answers3

9

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
jacobsa
  • 5,719
  • 1
  • 28
  • 60
1

If you have installed gcsfuse, you can mount an specific directory of the google cloud bucket using the only_dir (for example only_dir=/foldername/) parameter in the /etc/fstab line.

my-bucket /mount/point gcsfuse rw,noauto,user,key_file=/home/ubuntu/key-gcp-storage.json,only_dir=/foldername/

This works for me in Ubuntu 18.

august0490
  • 777
  • 1
  • 9
  • 15
0

In my case, the folder was not created at the destination. I was trying to mount to specific path in bucket and in that bucket, I did create that path.

Creating that path resolved the issue..