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

eilalan
  • 669
  • 4
  • 20

1 Answers1

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.

yelsayed
  • 5,236
  • 3
  • 27
  • 38
  • Thank you for your response. i have edited the startup script that is available on the datalab vm: – eilalan Jan 24 '18 at 16:31
  • 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? thanks – eilalan Jan 24 '18 at 16:38
  • and i wish to mount a bucket, is it possible to use the -v option for that: -v /mnt/:/mnt/:shared – eilalan Jan 24 '18 at 16:48
  • 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. – yelsayed Jan 25 '18 at 22:32