'fd=N'
The file descriptor to use for communication between the userspace
filesystem and the kernel. The file descriptor must have been
obtained by opening the FUSE device ('/dev/fuse').
'rootmode=M'
The file mode of the filesystem's root in octal representation.
'user_id=N'
The numeric user id of the mount owner.
'group_id=N'
The numeric group id of the mount owner.
'default_permissions'
By default FUSE doesn't check file access permissions, the
filesystem is free to implement its access policy or leave it to
the underlying file access mechanism (e.g. in case of network
filesystems). This option enables permission checking, restricting
access based on file mode. It is usually useful together with the
'allow_other' mount option.
'allow_other'
This option overrides the security measure restricting file access
to the user mounting the filesystem. This option is by default only
allowed to root, but this restriction can be removed with a
(userspace) configuration option.
'max_read=N'
With this option the maximum size of read operations can be set.
The default is infinite. Note that the size of read requests is
limited anyway to 32 pages (which is 128kbyte on i386).
'blksize=N'
Set the block size for the filesystem. The default is 512. This
option is only valid for 'fuseblk' type mounts.
mount卸载不掉,多半是权限不够:
tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 0
tmpfs /run/user/1002 tmpfs rw,nosuid,nodev,relatime,size=6574104k,mode=700,uid=1002,gid=1002 0 0
tmpfs /run/user/1001 tmpfs rw,nosuid,nodev,relatime,size=6574104k,mode=700,uid=1001,gid=1001 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=6574104k,mode=700,uid=1000,gid=1000 0 0
block_fs_mount /home/luotang/bfs fuse.block_fs_mount rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
luotang@10-23-227-66:~/blockfs$ umount /home/luotang/bfs
umount: /home/luotang/bfs: Transport endpoint is not connected
luotang@10-23-227-66:~/blockfs$ ps aux | grep mount
luotang 486129 0.0 0.0 13144 1024 pts/7 S+ 09:53 0:00 grep --color=auto mount
luotang@10-23-227-66:~/blockfs$ ll /home/luotang/bfs
ls: cannot access '/home/luotang/bfs': Transport endpoint is not connected
luotang@10-23-227-66:~/blockfs$ sudo umount /home/luotang/bfs
tmpfs /run/user/1002 tmpfs rw,nosuid,nodev,relatime,size=6574104k,mode=700,uid=1002,gid=1002 0 0
tmpfs /run/user/1001 tmpfs rw,nosuid,nodev,relatime,size=6574104k,mode=700,uid=1001,gid=1001 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=6574104k,mode=700,uid=1000,gid=1000 0 0
luotang@10-23-227-66:~/blockfs$ ^C
luotang@10-23-227-66:~/blockfs$
也可以
Edit /etc/fuse.conf so you never meet the fuse:
bad mount point `/mnt': Transport endpoint is not connected error again
Open it as root with your favorite editor, for example
vim /etc/fuse.conf
luotang@10-23-227-66:~/blockfs$ cat /etc/fuse.conf
# The file /etc/fuse.conf allows for the following parameters:
#
# user_allow_other - Using the allow_other mount option works fine as root, in
# order to have it work as user you need user_allow_other in /etc/fuse.conf as
# well. (This option allows users to use the allow_other option.) You need
# allow_other if you want users other than the owner to access a mounted fuse.
# This option must appear on a line by itself. There is no value, just the
# presence of the option.
#user_allow_other
# mount_max = n - this option sets the maximum number of mounts.
# Currently (2014) it must be typed exactly as shown
# (with a single space before and after the equals sign).
#mount_max = 1000
luotang@10-23-227-66:~/blockfs$
Uncomment the user_allow_other line.
$ git clone https://github.com/libfuse/libfuse
编译libfuse
You can download libfuse from
https://github.com/libfuse/libfuse/releases. To build and install, you
must use [Meson](http://mesonbuild.com/) and
[Ninja](https://ninja-build.org). After extracting the libfuse
tarball, create a (temporary) build directory and run Meson:
$ mkdir build; cd build
$ meson ..
Other way to define install dir:
$ meson --prefix=/usr build
Normally, the default build options will work fine. If you
nevertheless want to adjust them, you can do so with the
*meson configure* command:
$ meson configure # list options
$ meson configure -D disable-mtab=true # set an option
To build, test, and install libfuse, you then use Ninja:
$ ninja
$ sudo python3 -m pytest test/
$ sudo ninja install
Running the tests requires the [py.test](http://www.pytest.org/)
Python module. Instead of running the tests as root, the majority of
tests can also be run as a regular user if *util/fusermount3* is made
setuid root first:
$ sudo chown root:root util/fusermount3
$ sudo chmod 4755 util/fusermount3
$ python3 -m pytest test/
luotang@10-23-227-66:~/blockfs/build$ sudo ./app/bfs_mount -V
[876191 20210120 11:06:15.627125Z][INFO][app/bfs_mount.cc:329] FUSE version: 3.10.1
FUSE library version 3.10.1
using FUSE kernel interface version 7.31
fusermount3 version: 3.10.1
[876191 20210120 11:06:15.627930Z][ERROR][app/bfs_mount.cc:362] fuse mount exit
luotang@10-23-227-66:~/blockfs/build$
luotang@10-23-227-66:~/blockfs/build$ sudo ./app/bfs_mount -h
[sudo] password for luotang:
[875750 20210120 11:04:46.009927Z][INFO][app/bfs_mount.cc:329] FUSE version: 3.10.1
usage: ./app/bfs_mount [options] <mountpoint>
FUSE options:
-h --help print help
-V --version print version
-d -o debug enable debug output (implies -f)
-f foreground operation
-s disable multi-threaded operation
-o clone_fd use separate fuse device fd for each thread
(may improve performance)
-o max_idle_threads the maximum number of idle worker threads
allowed (default: 10)
-o kernel_cache cache files in kernel
-o [no]auto_cache enable caching based on modification times (off)
-o umask=M set file permissions (octal)
-o uid=N set file owner
-o gid=N set file group
-o entry_timeout=T cache timeout for names (1.0s)
-o negative_timeout=T cache timeout for deleted names (0.0s)
-o attr_timeout=T cache timeout for attributes (1.0s)
-o ac_attr_timeout=T auto cache timeout for attributes (attr_timeout)
-o noforget never forget cached inodes
-o remember=T remember cached inodes for T seconds (0s)
-o modules=M1[:M2...] names of modules to push onto filesystem stack
-o allow_other allow access by all users
-o allow_root allow access by root
-o auto_unmount auto unmount on process termination
Options for subdir module:
-o subdir=DIR prepend this directory to all paths (mandatory)
-o [no]rellinks transform absolute symlinks to relative
Options for iconv module:
-o from_code=CHARSET original encoding of file names (default: UTF-8)
-o to_code=CHARSET new encoding of the file names (default: UTF-8)
[875750 20210120 11:04:46.010178Z][ERROR][app/bfs_mount.cc:362] fuse mount exit
luotang@10-23-227-66:~/blockfs/build$