4

I'm trying to mount GCS buckets on demand with autofs. Closest they have instructions for is SSHFS like this:

mntpoint -fstype=fuse,allow_other :sshfs\#user@example.com\:

Following that example I do:

mntpoint -fstype=fuse,allow_other :gcsfuse\#my-bucket\:

But that doesn't work for me and I don't know how to see any error information for what might have gone wrong. Here are my autofs configs:

# grep "^#" -v /etc/auto.master
+dir:/etc/auto.master.d
+auto.master
# grep "^#" -v /etc/auto.master.d/mnt.autofs 
/mnt /etc/autofs/auto.mnt
# grep "^#" -v /etc/autofs/auto.mnt 
/- -fstype=fuse,allow_other,r :gcsfuse\#dfci-mev-def-12345-678\:

Mount works normally like this:

gcsfuse -o allow_other my-bucket /mnt

With google service account credential file location in GOOGLE_APPLICATION_CREDENTIAL environment variable

UPDATE

I changed spaces in config to tabs, simplified a bit and turned on verbose output for automount, my configs look like this now:

# cat /etc/auto.master                                                                                                                                                                                                 
/mnt    /etc/auto.gcsfuse   --timeout=0 --ghost --verbose

# cat /etc/auto.gcsfuse 
dfci-mev-def-12345-678  -fstype=fuse,rw,allow_other :gcsfuse\#dfci-mev-def-12345-678

dfci-mev-def-12345-678 is my test bucket. I can now see it in /mnt. It looks like a folder. When I try to cd into it it says "No such file or directory" and the output from auto mount looks like this:

attempting to mount entry /mnt/dfci-mev-def-12345-678
>> gcsfuse takes exactly two arguments. Run `gcsfuse --help` for more info.
mount(generic): failed to mount gcsfuse#dfci-mev-def-12345-678 (type fuse) on /mnt/dfci-mev-def-12345-678
failed to mount /mnt/dfci-mev-def-12345-678
re-reading map for /mnt

UPDATE 2

I figured out what's going on, but I do not have a solution. My second set of configs is correct; gcsfuse doesn't like its mount options after bucket and mount point arguments, I opened a ticket with them at https://github.com/GoogleCloudPlatform/gcsfuse/issues/216

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.