Mount google cloud storage bucket as disk to linux instance with custom size

fusegcsfusegoogle-cloud-platformgoogle-cloud-storagegoogle-compute-engine

We can mount Google Cloud Storage Bucket as a disk to an instance using Cloud FUSE. By doing so, we are getting 1 PiB as disk size(bucket). Can anybody help me understand why we are getting 1 PiB specifically? Can we modify this size while mounting? and how to automount this disk(bucket) with overridden permissions, i.e what should be the entry in /etc/fstab. I have changed the default directory permission(755) and file permission(644) to 770 and 666 respectively using –

mount -t gcsfuse -o allow_other -o dir_mode=770 -o file_mode=666 bucketname /path/to/mountpoint/

Thanks in advance.

Best Answer

The size is shown as 1 PiB because the size of a GCS bucket is (theoretically) limitless, and a mount-point is required to have a finite size. The only limit is 5TB per object within the bucket.

Reference:

There is a maximum size limit of 5 TB for individual objects stored in Cloud Storage.

https://cloud.google.com/storage/quotas

Regarding your query on mounting via /etc/fstab, the detail you need is readily available within the gcsfuse documentation:

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

https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/mounting.md#mount8-and-fstab-compatibility