Mount Google Cloud Storage Bucket to Instance
Asked Answered
F

3

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.

Forrer answered 30/9, 2015 at 0:50 Comment(0)
F
21

With the new beta gcsfuse this is now possible.

gcsfuse myBucket ~/path/to/mount

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

Forrer answered 30/9, 2015 at 9:0 Comment(5)
Is there any way to do this in windows?Hluchy
@Hluchy given your name your question confuses me. Kidding, you should be able to use mingw or something. Docker would be great.Forrer
@Hluchy haha :D mac or nix?Forrer
mac for dev, nix for server :) i'm having a time though learning the command promptHluchy
@Hluchy Learning nix style terminal is one of the best things you can do. Now your on mac never look backForrer
S
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

Slemmer answered 22/11, 2019 at 9:56 Comment(0)
B
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

Brunobruns answered 9/8, 2022 at 8:35 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.