gcsfuse on datalab vm machine. Error: fusermount: fuse device not found, try 'modprobe fuse' first
Asked Answered
C

1

4

I have installed gcsfuse on a datalab machine. Created a target machine and used chmod to allow writing permission to all calling:

!gcsfuse --foreground --debug_fuse archs4 /content/datalab/mount/

I am getting the following error:

Opening bucket...
Mounting file system...
mountWithArgs: mountWithConn: Mount: mount: running fusermount: exit status 1

stderr:
fusermount: fuse device not found, try 'modprobe fuse' first

any idea what might solve that issue? (I am using: gcsfuse version 0.23.0 (Go version go1.9))

Thanks a lot, Eila

Claribelclarice answered 23/1, 2018 at 17:4 Comment(1)
For those who are running gscfuse in Cloud Run here is another answer serverfault.com/a/1098561/450511Lilalilac
F
4

For any FUSE file system to work in a Docker container, you'll need to run the container in privileged mode. If you don't want to do this, at least you'll need these flags set when starting the container:

--security-opt apparmor:unconfined --cap-add mknod --cap-add sys_admin --device=/dev/<fuse_device> -v /mnt/<mnt_point>:/mnt/<mnt_point>:shared

Where fuse_device is the name of the FUSE drive you're using (for example gcsfuse), and mnt_point is the path you're mounting it at.

Keep in mind that Datalab doesn't run in privileged more or use these flags by default, so if you're running Datalab using the CLI tool (datalab create command), this won't work.

Franke answered 24/1, 2018 at 4:48 Comment(4)
Thank you for your response. i have edited the startup script that is available on the datalab vm:Claribelclarice
Thanks. I have edited the startup script that is available on the datalab compute engine settings to be: docker run --rm --cap-add SYS_ADMIN -v "${MOUNT_DIR}/content:/content" --privileged --entrypoint "/bin/bash" gcr.io/cloud-datalab/datalab:latest gcloud source repos clone datalab-notebooks /content/datalab/notebooks . Added: --cap-add SYS_ADMIN and --privileged . should that be enough? I am starting the datalab, installing gcsfuse, creating a folder with write access to all and will run gcsfuse bucket folder . will that be enough or should i add the parameters in your response? thanksClaribelclarice
and i wish to mount a bucket, is it possible to use the -v option for that: -v /mnt/<mnt_point>:/mnt/<mnt_point>:sharedClaribelclarice
I think you still need to add the mknod capability. As for the -v flag, you use that to bind a mount point, and you'll mount the bucket from inside the container. You might need to make the volume shared first.Franke

© 2022 - 2024 — McMap. All rights reserved.