Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

s3fs unmount: directory is not empty

I'm using s3fs and osxfuse to mount an S3 directory on my Mac:

s3fs my-bucket-name $PWD/s3

When it's time to unmount it, I do this:

% s3fs umount $PWD/s3
s3fs: MOUNTPOINT directory /Users/kwilliams/blah/s3 is not empty.
if you are sure this is safe, can use the 'nonempty' mount option.

I am not sure this is safe - I didn't knowingly create any new files in the s3 directory, and if any new ones were created, I need to know about it so I can clean them up or figure out what happened.

I also don't want it to perform any actions (creation, deletion) on the underlying S3 bucket when trying to unmount. I'm not sure what the nonempty option will do.

The directory certainly appears nonempty when I do ls, because it shows me the contents of the bucket.

Finally - the message says I can use the 'nonempty' mount option - is it saying I should have used that option at mount time, or I can use it when unmounting? s3fs --help doesn't indicate that s3fs umount can take any options.

like image 300
Ken Williams Avatar asked May 10 '19 15:05

Ken Williams


3 Answers

Okay, I feel silly - I figured out the answer right after posting. I'm not supposed to do s3fs umount $PWD/s3, just umount $PWD/s3.

The former is presumably trying to mount another bucket called umount at the same path where the previous one is mounted.

like image 174
Ken Williams Avatar answered Oct 08 '22 08:10

Ken Williams


In a normal case, you can simply unmount the directory using umount from the root

$ umount /mountpoint

For unprivileged user

fusermount -u /mountpoint

else use this to umount directly if shows Device or resource busy / directory is not empty / Permission denied

umount -l /mounthpath

and do rm -rf /path if not needed anymore. FYI : needed more details about s3fs https://www.mankier.com/1/s3fs#

like image 25
Mithlaj Avatar answered Oct 08 '22 07:10

Mithlaj


You can also use fusermount:

fusermount -u $PWD/s3

You may need to install fusermount first

like image 24
Jonathan Chow Avatar answered Oct 08 '22 08:10

Jonathan Chow