Skip to content
Posted on:August 25, 2022 at 07:00 AM

GCSFuse

GCSFuse

GCSFuse is a great utility to mount the GCS bucket into your local computer. I used it to access the data from my local computer or VMs in the cloud to access the data in the GCS bucket.

1. How to install gcsfuse

1.1 Mac

  1. Do not use brew to install gcsfuse. due to the depencies to the FUSE, homebrew is deprecating gcsfuse
  2. install go first
brew install go
  1. build from source:
GO111MODULE=auto go get -u github.com/googlecloudplatform/gcsfuse

More info: https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/installing.md#building-from-source

1.2 Ubuntu

  1. get the key
export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s`
echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
  1. update he packages and install
sudo apt-get update
sudo apt-get install gcsfuse

More Info: https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/installing.md#linux

2. How to mount

gcsfuse --implicit-dirs my-gcs-bucket ~/my-gcs-bucket

3. How to unmount

unmount ~/my-gcs-bucket