Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use S3 a ton. I have over 40 or so buckets floating around between clients. I like the fact that I can list them in /etc/fstab and that they just work. For reference here is one of the buckets.

coteyrnet /mnt/S3/coteyrnet fuse.s3fs _netdev,use_cache=/tmp,use_rrs=1,allow_other,noauto,users 0 0

It mounts fine, but I am having one heck of a time unmounting it.

The first problem is:

umount: /mnt/S3/coteyrnet mount disagrees with the fstab

The relevant part of mtab is:

s3fs /mnt/S3/coteyrnet fuse.s3fs rw,noexec,nosuid,nodev,allow_other,user=coteyr 0 0

When running mount with no arguments it reports the mount as:

s3fs on /mnt/S3/coteyrnet type fuse.s3fs (rw,noexec,nosuid,nodev,allow_other,user=coteyr)

In addition to that, if I sudo umount /mnt/S3/coteyrnet I always get

umount: /mnt/S3/coteyrnet: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))

lsof | grep coteyrnet never returns anything of value, nor does fuser.

My goal is to get user unmounting working.

The inability to mount via sudo has been resolved. By using the "use_cache" setting the files were actually open, but not under the mount point. This is a caveat to that option. The mount point files are closed but the files were not yet transferred to S3. By waiting "a while" and trying again, sudo can unmount.

share|improve this question
you can get a list of opened files under /mnt/S3/coteyrnet by using lsof +D /mnt/S3/coteyrnet and try to close them. –  Ankit Nov 21 '12 at 10:48
There are no open files returned –  coteyr Nov 21 '12 at 10:58
OK that is odd, after running that command it unmounted fine (using sudo not as a user). Going to look into something. –  coteyr Nov 21 '12 at 11:00
Updated the question. sudo unmount now works fine. It was just an "issue" with the s3fs layer and how it handled caching. I do not want to remove that part of the question because I think others will stumble across it. I also don't want to put it in as an answer because it doesn't solve the primary problem of unmounting as a user. –  coteyr Nov 21 '12 at 11:10
I am surprised that no body else has a problem like this one. –  coteyr Nov 27 '12 at 17:34
add comment

2 Answers

up vote 1 down vote accepted

After working with dpb, we have determined that the issue is a bug and not a lack of knowledge or configuration (it can't be fixed by us)

Issue 309 has been filed with s3fs maintainers.

share|improve this answer
dpb's answer was most helpful, but unfortunately the fix was file a bug report, and not modifying the fstab entry. –  coteyr Dec 1 '12 at 18:37
add comment

I think /etc/fstab needs the option user. Right now you said you have:

s3fs /mnt/S3/coteyrnet fuse.s3fs rw,noexec,nosuid,nodev,allow_other,user=coteyr 0 0

Trying changing that user=coteyr to just user. That works for me. When I tried to specify the user with =, it was essentially ignored.

See the following output for an example:

dpb@helo:crash$ mount /mnt/foo
dpb@helo:crash$ umount /mnt/foo
dpb@helo:crash$ grep /mnt/foo /etc/fstab
/dev/vgdata/lvol0 /mnt/foo ext4 defaults,user 0 2

Alternate Solution

If this fails, or if you want an alternate approach. You can set up a sudo rule that allows mounting and unmounting without a password for certain mounts. Some would claim this is a safer approach, but I'm no security guru.

More specifics for fuse.s3fs

It appears for umount as a non superuser to succeed, it needs to match what is shown by the mount command.

In this case, fstab would need to look like

s3fs   /mnt/S3/coteyrnet  fuse.s3fs  <options> 0 0

But, I think you still need a way to specify your unique bucket. Perhaps try:

s3fs#coteyrnet  /mnt/S3/coteyrnet  fuse.s3fs  <options> 0 0

That may be enough to trick mount (I've seen that before in a couple places, and now I'm starting to realize why)

share|improve this answer
The alternate solution is a no go. I don't really want to have to sudo every time I unmount I can do that now. I will give the primary solution a try and let you know. –  coteyr Nov 27 '12 at 18:57
I still get umount: /mnt/S3/coteyrnet mount disagrees with the fstab –  coteyr Nov 27 '12 at 19:00
also /etc/fstab has the users flag, mtab has the user=coteyr flag –  coteyr Nov 27 '12 at 19:00
ah, thx about mtab/fstab missed that. Still, is it 'users' or 'user' in fstab? Also, did you unmount everything and fix /etc/fstab, then try to mount/unmount? –  dpb Nov 27 '12 at 19:08
users is what I have in fstab, I will give just user a try. Yes I did full unmount and mount of everything except / –  coteyr Nov 27 '12 at 19:27
show 8 more comments

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.