Skip to content

Feature request: mount command for OpenBSD #1727

Closed

Description

OpenBSD has fuse support (userland) [1]. Hopefully this is doable with rclone / GOLANG. 1): https://man.openbsd.org/fuse_main.3

Activity

  1. ncw commented on Oct 9, 2017

    @ncw
    Member

    rclone actually has two fuse subsystems! Linux and OS X use

    Whereas Windows (but it would work on Linux and OS X too) use

    So for rclone to gain support one of those libraries would need to support OpenBSD.

    I made an issue on cgofuse to ask the author what he thinks.

  2. added this to the Help Wanted milestone on Aug 30, 2018
  3. lkostal commented on Aug 21, 2020

    @lkostal

    Anything I can help with (as OpenBSD user)?

  4. ncw commented on Aug 21, 2020

    @ncw
    Member

    It looks like cgofuse supports OpenBSD now. So trying it would be a matter of changing the build constraints in all the files in the cmd/cmount package and trying to compile it.

    // +build cmount
    // +build cgo
    // +build linux darwin freebsd windows

    If it compiles (build with -tags cmount) then see if it works!

    Do you want to give that a try @lkostal ?

  5. lkostal commented on Aug 21, 2020

    @lkostal

    It compiles (on latest OpenBSD -current with go1.15beta1), but when try to run it ends up with:

    fuse: Invalid value head=131072 for option max_read=%u
    2020/08/21 19:06:14 ERROR : One drive root 'Temp': Mount failed
    2020/08/21 19:06:14 Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed

  6. lkostal commented on Aug 21, 2020

    @lkostal

    After commenting out following two options from cmd/cmount/mount.go it mounts the remote:

    "-o", fmt.Sprintf("max_readahead=%d", opt.MaxReadAhead),
    "-o", "atomic_o_trunc",
    

    But mounted directory "seems" to be empty.

    When not mounted (details about directory are shown):

    # ls -al onedrive/
    total 8
    drwxr-xr-x  2 root  wheel  512 Aug 21 19:00 .
    drwx------  6 root  wheel  512 Aug 21 19:01 ..
    #
    

    When mounted (no directory information is shown at all):

    # ls -al onedrive/
    #
    
  7. ncw commented on Aug 25, 2020

    @ncw
    Member

    You might need to include --allow-other and or --allow-root

    FUSE isn't normally mounted as root but I remember reading that in openbsd it has to be? What happens if you mount it as a user?

    The above is the usual cause of empty directories.

    Also put -vv on the rclone mount command and post the output.

  8. lkostal commented on Aug 26, 2020

    @lkostal

    I have to mount it as root (doesn't work as user on OpenBSD). No change when --allow-other included (--allow-root doesn't work). Here is the debug output:

    # ./rclone cmount remote:/ /root/onedrive -vv --vfs-cache-mode writes
    2020/08/26 07:27:42 DEBUG : rclone: Version "v1.52.3-DEV" starting with parameters ["./rclone" "cmount" "remote:/" "/root/onedrive" "-vv" "--vfs-cache-mode" "writes"]
    2020/08/26 07:27:42 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
    2020/08/26 07:27:43 DEBUG : fs cache: renaming cache item "remote:/" to be canonical "remote:"
    2020/08/26 07:27:43 INFO  : One drive root '': poll-interval is not supported by this remote
    2020/08/26 07:27:43 DEBUG : vfs cache: root is "/root/.cache/rclone/vfs/remote"
    2020/08/26 07:27:43 DEBUG : vfs cache: metadata root is "/root/.cache/rclone/vfs/remote"
    2020/08/26 07:27:43 DEBUG : One drive root '': Mounting on "/root/onedrive"
    2020/08/26 07:27:43 DEBUG : One drive root '': Mounting with options: ["-o" "fsname=remote:" "-o" "subtype=rclone" "-o" "attr_timeout=1"]
    2020/08/26 07:27:43 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
    2020/08/26 07:27:43 DEBUG : One drive root '': Init:
    2020/08/26 07:27:43 DEBUG : One drive root '': >Init:
    

    When doing 'ls -al':

    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Opendir:
    2020/08/26 07:27:49 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
    2020/08/26 07:27:49 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
    2020/08/26 07:27:49 DEBUG : /: >Opendir: errc=0, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Readdir: ofst=0, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Readdir: items=14, errc=0
    2020/08/26 07:27:49 DEBUG : /: Readdir: ofst=552, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Readdir: items=-1, errc=-29
    2020/08/26 07:27:49 DEBUG : /: Releasedir: fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Releasedir: errc=0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Opendir:
    2020/08/26 07:27:49 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
    2020/08/26 07:27:49 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
    2020/08/26 07:27:49 DEBUG : /: >Opendir: errc=0, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
    2020/08/26 07:27:49 DEBUG : /: >Getattr: errc=0
    2020/08/26 07:27:49 DEBUG : /: Readdir: ofst=0, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Readdir: items=14, errc=0
    2020/08/26 07:27:49 DEBUG : /: Readdir: ofst=552, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Readdir: items=-1, errc=-29
    2020/08/26 07:27:49 DEBUG : /: Releasedir: fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Releasedir: errc=0
    
  9. ncw commented on Aug 26, 2020

    @ncw
    Member

    2020/08/26 07:27:49 DEBUG : /: Readdir: ofst=0, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Readdir: items=14, errc=0

    So it read 14 items which is good

    2020/08/26 07:27:49 DEBUG : /: Readdir: ofst=552, fh=0x0
    2020/08/26 07:27:49 DEBUG : /: >Readdir: items=-1, errc=-29

    Then it tried to read some more which returned an error

    This probably needs a small patch to just return 0 items if the offset is non zero.

  10. ncw commented on Aug 26, 2020

    @ncw
    Member

    This seems like it might be a bug in cgofuse

  11. ncw commented on Sep 1, 2020

    @ncw
    Member

    There is something strange going on in the directory reading routines - I reported an upstream issue here: winfsp/cgofuse#49

    I've added a workaround for that and collected up the other patches here on branch fix-1727-openbsd-cmount

    If you pull that branch then do go build -tags cmount you should have an rclone cmount which works on OpenBSD.

    I haven't run the integration tests on this yet but I will as soon as I get them working! (Conditional compile problems!)

  12. added a commit that references this issue on Sep 1, 2020
    f60476e
  13. 14 remaining items

  14. mischief commented on Jan 22, 2026

    @mischief
    Contributor

    hi,

    took a poke at this earlier. the first issue was that cgofuse shared library loading was broken as observed in #1727 (comment), which should be fixed by winfsp/cgofuse#100.

    there's some trivial build directives that need to be cleaned up, and rclone tries to pass some unsupported fuse options, but those are easy to fix.

    the last issue is the readdir offset, which i am still confused about. i bodged this in my branch by just continuing the request even if ofst is nonzero, which made the mount work finally.

    see master...mischief:rclone:openbsd for my changes.

    it seems the build directives, mount options and fuse options are addressed in @ncw's https://github.com/rclone/rclone/tree/fix-1727-openbsd-cmount branch, so i think if rclone updates its cgofuse dependency when winfsp/cgofuse#100 is merged, this should be solved.

  15. added a commit that references this issue on Jan 27, 2026
  16. mischief commented on Jan 27, 2026

    @mischief
    Contributor

    @ncw with #9122 merged, will you PR your own branch for mount or should i prepare my own?

  17. added a commit that references this issue on Jan 28, 2026
    f8baa68
  18. added a commit that references this issue on Jan 29, 2026
    cc9abca
  19. added a commit that references this issue on Feb 14, 2026
  20. hjicks commented on May 14, 2026

    @hjicks

    it seems rclone binaries don't have the mount command for the openbsd builds:

    $ ./rclone -h
    Rclone syncs files to and from cloud storage providers as well as
    mounting them, listing them in lots of different ways.
    
    See the home page (https://rclone.org/) for installation, usage,
    documentation, changelog and configuration walkthroughs.
    
    Usage:
      rclone [flags]
      rclone [command]
    
    Available commands:
      about       Get quota information from the remote.
      archive     Perform an action on an archive.
      authorize   Remote authorization.
      backend     Run a backend-specific command.
      bisync      Perform bidirectional synchronization between two paths.
      cat         Concatenates any files and sends them to stdout.
      check       Checks the files in the source and destination match.
      checksum    Checks the files in the destination against a SUM file.
      cleanup     Clean up the remote if possible.
      completion  Output completion script for a given shell.
      config      Enter an interactive configuration session.
      convmv      Convert file and directory names in place.
      copy        Copy files from source to dest, skipping identical files.
      copyto      Copy files from source to dest, skipping identical files.
      copyurl     Copy the contents of the URL supplied content to dest:path.
      cryptcheck  Cryptcheck checks the integrity of an encrypted remote.
      cryptdecode Cryptdecode returns unencrypted file names.
      dedupe      Interactively find duplicate filenames and delete/rename them.
      delete      Remove the files in path.
      deletefile  Remove a single file from remote.
      gendocs     Output markdown docs for rclone to the directory supplied.
      gitannex    Speaks with git-annex over stdin/stdout.
      gui         Open the web based GUI.
      hashsum     Produces a hashsum file for all the objects in the path.
      help        Show help for rclone commands, flags and backends.
      link        Generate public link to file/folder.
      listremotes List all the remotes in the config file and defined in environment variables.
      ls          List the objects in the path with size and path.
      lsd         List all directories/containers/buckets in the path.
      lsf         List directories and objects in remote:path formatted for parsing.
      lsjson      List directories and objects in the path in JSON format.
      lsl         List the objects in path with modification time, size and path.
      md5sum      Produces an md5sum file for all the objects in the path.
      mkdir       Make the path if it doesn't already exist.
      move        Move files from source to dest.
      moveto      Move file or directory from source to dest.
      ncdu        Explore a remote with a text based user interface.
      nfsmount    Mount the remote as file system on a mountpoint.
      obscure     Obscure password for use in the rclone config file.
      purge       Remove the path and all of its contents.
      rc          Run a command against a running rclone.
      rcat        Copies standard input to file on remote.
      rcd         Run rclone listening to remote control commands only.
      rmdir       Remove the empty directory at path.
      rmdirs      Remove empty directories under the path.
      selfupdate  Update the rclone binary.
      serve       Serve a remote over a protocol.
      settier     Changes storage class/tier of objects in remote.
      sha1sum     Produces an sha1sum file for all the objects in the path.
      size        Prints the total size and number of objects in remote:path.
      sync        Make source and dest identical, modifying destination only.
      test        Run a test command
      touch       Create new file or change file modification time.
      tree        List the contents of the remote in a tree like fashion.
      version     Show the version number.
    
    Use "rclone [command] --help" for more information about a command.
    Use "rclone help flags" for to see the global flags.
    Use "rclone help backends" for a list of supported services.
    
    $ ./rclone version
    rclone v1.74.1
    - os/version: openbsd 7.8 (64 bit)
    - os/kernel: 7.8 (amd64)
    - os/type: openbsd
    - os/arch: amd64
    - go/version: go1.26.3
    - go/linking: static
    - go/tags: none
    

    i can't see mount here, nor it works.

  21. mischief commented on May 14, 2026

    @mischief
    Contributor

    it seems rclone binaries don't have the mount command for the openbsd builds:

    ...

    $ ./rclone version
    rclone v1.74.1

    • os/version: openbsd 7.8 (64 bit)
    • os/kernel: 7.8 (amd64)
    • os/type: openbsd
    • os/arch: amd64
    • go/version: go1.26.3
    • go/linking: static
    • go/tags: none
    
    i can't see `mount` here, nor it works.
    

    you appear to lack build tags. see https://github.com/openbsd/ports/blob/master/sysutils/rclone/Makefile#L24.

  22. hjicks commented on May 14, 2026

    @hjicks

    very well. thanks!

  23. added a commit that references this issue on Nov 21, 2026
    d2a689b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions