How to register FUSE filesystem type with mount(8) and fstab?

后端 未结 5 1061
醉酒成梦
醉酒成梦 2021-01-31 03:08

I\'ve written a small FUSE-based filesystem and now the only part\'s missing is that I want to register it with fstab(5) to auto-mount it on system startup and/or manually mount

5条回答
  •  猫巷女王i
    2021-01-31 03:46

    So to clarify ephemient's answer, there are two options:

    1. Edit /etc/fstab like this:

      #                       
      # ...
      vdbfs.py#    /srv/virtual-db    fuse    user,    0    0
      

      Or,

    2. Create an executable prefixed with "mount." (ensuring it can be used with mount-like options):

      $ ln -s /usr/bin/vdbfs.py /usr/sbin/mount.vdbfs
      

      And edit /etc/fstab like this:

      #                  
      # ...
          /srv/virtual-db    vdbfs.py    user,    0    0
      

    With regards to auto-mounting at start up and manually mounting with mount, the user and noauto options are relevant and fully supported by fuse itself so you don't have to implement them yourself. The user option lets a non-priveleged user who is a member of the "fuse" group mount your filesystem with the mount command, and noauto directs your filesystem not to automatically mount at startup. If you don't specify noauto, it will automatically mount.

提交回复
热议问题