0

Currently I have a VM that runs CentOS 7 and would like to auto mount a bucket using a non root user.

I have installed NextCloud and would like to point local data folder to Google Cloud Storage.

Tried various examples but none of them seemed to work, at all.

Here's what I've tried:

The mount works but not the creation of any file / folder as a sub folder or file placed within the mounted folder

gcsfuse my-nextcloud-bucket /mnt/myserverdata/cloudmysite/public_html/data
gcsfuse -o nonempty my-nextcloud-bucketcom /mnt/myserverdata/cloudmysite/public_html/data

The following ones I've tried to place each try on /etc/fstab (end of file)

my-nextcloud-bucket /mnt/myserverdata/cloudmysite/public_html/data gcsfuse rw,noauto,cloudmysite,key_file=/mnt/myserverdata/cloudmysite/_gcloud-credentials/gc--1f54d021ca11.json
my-nextcloud-bucket /mnt/myserverdata/cloudmysite/public_html/data gcsfuse rw,gid=1068,uid=1065,noauto,user,allow_other,_netdev
my-nextcloud-bucket /mnt/myserverdata/cloudmysite/public_html/data gcsfuse rw,allow_other,file_mode=777,dir_mode=777

How I can mount (fstab or on reboot to be persistent) under cloudmysite user which is a non root user?

el.severo
  • 87
  • 1
  • 10

1 Answers1

2

This is mentioned in the docs of gcsfuse.

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

I tested this and the bucket was mounted with my user.