Before you begin, make sure you have the following:
First, create a directory for the Rclone configuration file:
mkdir -p ~/.config/rclone
Then, create the configuration file itself:
touch ~/.config/rclone/rclone.conf
Next, configure Rclone to access your GCS bucket by adding the following to the configuration file:
[gc]
type = gcs
project_id = <your project id here>
object_acl = bucketOwnerFullControl
token = {"<your token here>"}
Create a directory where you want to mount your GCS bucket:
mkdir -p ~/gc
Now, you can mount your GCS bucket by running the following command:
rclone mount gc: <path to mount point> &
For example, to mount the GCS bucket to the ~/gc directory, you would run:
rclone mount gc: ~/gc &
To make sure that your GCS bucket is automatically mounted on startup, add the mount command to your crontab:
(crontab -l 2>/dev/null; echo "@reboot rclone mount gc: $HOME/gc/ &") | crontab -
And that’s it! Your GCS bucket is now successfully mounted on your Linux machine and will be automatically mounted on startup. You can access the files in the GCS bucket by going to the mount point directory (~/gc in the example above). Keep in mind that you need to make sure you have the right permissions to access the GCS bucket and the files inside it.