[GH-ISSUE #518] Difficulty unmounting s3fs-mounted disk as user #287

Closed
opened 2026-03-04 01:44:04 +03:00 by kerem · 1 comment
Owner

Originally created by @houtanb on GitHub (Jan 4, 2017).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/518

Additional Information

s3fs version:

• s3fs --version
Amazon Simple Storage Service File System V1.80(commit:unknown) with GnuTLS(gcrypt)
Copyright (C) 2010 Randy Rizun <rrizun@gmail.com>
License GPL2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

fuse version:

• pkg-config --modversion fuse
2.9.3

System info:

• uname -a
Linux quaoar 3.12.64-guest-45-bc15ab7-x86_64 #2 SMP Thu Oct 20 15:39:45 UTC 2016 x86_64 GNU/Linux

Distro:

• cat /etc/issue
Debian GNU/Linux 8 \n \l

s3fs command line:

s3fs -o allow_other -o passwd_file=./.passwd-s3fs -o endpoint=eu-west-1 -o url=https://s3.amazonaws.com -o use_cache=/tmp/amazonS3cache -o del_cache bucketname /bacula/backupAmazonS3

/etc/fstab (have tried with and without)

s3fs          /bacula/backupAmazonS3   fuse.s3fs _netdev,rw,nosuid,nodev,relatime,user,allow_other 0 0

Log info:

• sudo grep s3fs /var/log/syslog
Jan  4 12:30:18 quaoar s3fs[4036]: s3fs.cpp:s3fs_init(3334): init v1.80(commit:unknown) with GnuTLS(gcrypt)
Jan  4 12:30:18 quaoar s3fs[4036]: Libgcrypt warning: missing initialization - please fix the application

Details about issue

Hi, first off, thanks for your work on s3fs. We use it to send our bacula server backups to Amazon. Everything works perfectly for me except for one thing. What I'd like to do is mount the amazon bucket as the bacula user before a server is backed up. Then, after the server has been backed up, I'd like to unmount the bucket, again as the bacula user. Everything works well (mounting, writing) except for the unmount step. When I run

umount /bacula/backupAmazonS3/

as the bacula user I get the error

umount: /bacula/backupAmazonS3: umount failed: Operation not permitted

which causes an error in my backup.

Now, I have tried playing with the fstab file adding the user option to no avail (see above). I have also tried removing the /etc/mtab soft link having read somewhere that this would allow a user to unmount a disk. Still no luck. Am I missing something very straightforward here?

Originally created by @houtanb on GitHub (Jan 4, 2017). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/518 #### Additional Information `s3fs` version: ``` • s3fs --version Amazon Simple Storage Service File System V1.80(commit:unknown) with GnuTLS(gcrypt) Copyright (C) 2010 Randy Rizun <rrizun@gmail.com> License GPL2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ``` `fuse` version: ``` • pkg-config --modversion fuse 2.9.3 ``` System info: ``` • uname -a Linux quaoar 3.12.64-guest-45-bc15ab7-x86_64 #2 SMP Thu Oct 20 15:39:45 UTC 2016 x86_64 GNU/Linux ``` Distro: ``` • cat /etc/issue Debian GNU/Linux 8 \n \l ``` `s3fs` command line: ``` s3fs -o allow_other -o passwd_file=./.passwd-s3fs -o endpoint=eu-west-1 -o url=https://s3.amazonaws.com -o use_cache=/tmp/amazonS3cache -o del_cache bucketname /bacula/backupAmazonS3 ``` `/etc/fstab` (have tried with and without) ``` s3fs /bacula/backupAmazonS3 fuse.s3fs _netdev,rw,nosuid,nodev,relatime,user,allow_other 0 0 ``` Log info: ``` • sudo grep s3fs /var/log/syslog Jan 4 12:30:18 quaoar s3fs[4036]: s3fs.cpp:s3fs_init(3334): init v1.80(commit:unknown) with GnuTLS(gcrypt) Jan 4 12:30:18 quaoar s3fs[4036]: Libgcrypt warning: missing initialization - please fix the application ``` #### Details about issue Hi, first off, thanks for your work on `s3fs`. We use it to send our bacula server backups to Amazon. Everything works perfectly for me except for one thing. What I'd like to do is mount the amazon bucket as the bacula user before a server is backed up. Then, after the server has been backed up, I'd like to unmount the bucket, again as the bacula user. Everything works well (mounting, writing) except for the unmount step. When I run ``` umount /bacula/backupAmazonS3/ ``` as the bacula user I get the error ``` umount: /bacula/backupAmazonS3: umount failed: Operation not permitted ``` which causes an error in my backup. Now, I have tried playing with the `fstab` file adding the `user` option to no avail (see above). I have also tried removing the `/etc/mtab` soft link having read somewhere that this would allow a user to unmount a disk. Still no luck. Am I missing something very straightforward here?
kerem closed this issue 2026-03-04 01:44:04 +03:00
Author
Owner

@houtanb commented on GitHub (Jan 4, 2017):

Solved. For anyone who encountered this issue, I created a file baculaumount in /etc/sudoers.d/ with visudo containing:

bacula ALL = NOPASSWD: /bin/umount /bacula/backupAmazonS3

and that allows bacula to run sudo umount /bacula/backupAmazonS3 without entering a password.

Though this works, I'd be happy to have any solution you think more elegant.

<!-- gh-comment-id:270358884 --> @houtanb commented on GitHub (Jan 4, 2017): Solved. For anyone who encountered this issue, I created a file `baculaumount` in `/etc/sudoers.d/` with `visudo` containing: ``` bacula ALL = NOPASSWD: /bin/umount /bacula/backupAmazonS3 ``` and that allows `bacula` to run `sudo umount /bacula/backupAmazonS3` without entering a password. Though this works, I'd be happy to have any solution you think more elegant.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#287
No description provided.