0

0 down vote favorite

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


Thanks for your reply. We mounted the bucket first using the above doucment

and later created a symbolic link to the mounted folder which makes it work

ln -s /mnt/s3/subfolderinsidebucket /your path

and in /etc/fstab

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

And again we faced a problem when the server restarted its not able to mount automatically

So we added an entry in crontab @reboot mount.sh and added the mount command inside the sh file

Sven
  • 97,248
  • 13
  • 177
  • 225
user28763
  • 21
  • 1
  • 1
  • 1

3 Answers3

1

Follow this doc- https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/mounting.md

You have to add this in /etc/fstab: my-bucket /mount/point gcsfuse rw,noauto,user

after you can run mount /mount/point as a non-root user.

obs: the noauto option above specifies that the file system should not be mounted at boot time.

I don't know if you can mount a specific folder in the bucket, but you can try my-bucket/foldername /mount/point gcsfuse rw,noauto,user (change ":" by "/")

1

@George's answer is close, but not correct for mounting a specific folder in the bucket.

To mount a specific folder in the bucket use this syntax:

my-bucket /mount/point gcsfuse rw,user,key_file=/path/to/key.json,only_dir=my_subdirectory

only_dir=my_subdirectory is the important part there.

You do not need a key_file= if you are mounting on a google compute instance.

Mike Furlender
  • 434
  • 1
  • 5
  • 17
1

very very late but... so, to mount specific subdirectory of a bucket in a mount point:

--> command

gcsfuse -o option1,option2 --only-dir sub_dirirectory/ -key-file=/path/to/key.json bucket_name /path/to/mount/point

--> fstab

bucket_name /path/to/mount/point gcsfuse rw,user,key_file=/path/to/key.json,only_dir=sub_directory

niainaLens
  • 111
  • 1