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.
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.
With the new beta gcsfuse
this is now possible.
gcsfuse myBucket ~/path/to/mount
install gcsfuse on your virtual instance.
then
$ gcsfuse {{bucket name}} ~{{mounting path}}
https://medium.com/google-cloud/scheduled-mirror-sync-sftp-to-gcs-b167d0eb487a
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
© 2022 - 2025 — McMap. All rights reserved.