15

How can I mount a Google Cloud Storage bucket as a disk or folder with a standard path such as ~/myBucket on a Google Compute instance?

Everything is in the same project with full access.

BAR
  • 15,909
  • 27
  • 97
  • 185

3 Answers3

20

With the new beta gcsfuse this is now possible.

gcsfuse myBucket ~/path/to/mount

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

BAR
  • 15,909
  • 27
  • 97
  • 185
1

install gcsfuse on your virtual instance.

then

$ gcsfuse {{bucket name}} ~{{mounting path}}

https://medium.com/google-cloud/scheduled-mirror-sync-sftp-to-gcs-b167d0eb487a

0

If you want to mount gcs on instance permanently then refer to this doc which says https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/mounting.md

If you would prefer to mount the file system automatically, you may need to pass the x-systemd.requires=network-online.target or _netdev option to ensure that gcsfuse waits for the network system to be ready prior to mounting

my-bucket /mount/point gcsfuse rw,x-systemd.requires=network-online.target,user You can also mount the file system automatically as a non-root user by specifying the options uid and/or gid:

my-bucket /mount/point gcsfuse rw,_netdev,allow_other,uid=1001,gid=1001