ITADN

On NixOS sshfs unmount fails on fuse3 systems: `fusermount` hardcoded instead of `fusermount3`

#2516Openkortschak 创建于 2026-06-12
Distro-SpecificDiscussionLow
K
kortschakcommented
### ‎ After configuring an SSH backup profile and approving the config in the "Manage profiles" dialog, BackInTime shows: > Unable to unmount sshfs from `/home/USER/.local/share/backintime/mnt/MOUNTID/mountpoint` The journal shows the mount succeeds, but unmount immediately fails: ``` INFO: mount ssh: USER@HOST.DOMAIN:/PATH/TO/backups on .../MOUNTID/mountpoint ERROR: fusermount: failed to unmount .../MOUNTID/mountpoint: Device or resource busy ``` The `fusermount` binary used is from fuse 2.9.9 (fuse2), but `sshfs` 3.7.3 is built against fuse3 and creates mounts that can only be unmounted with `fusermount3`. The fuse2 `fusermount` cannot unmount a fuse3 mount; it reports "Device or resource busy" instead of a permission error, which masks the real cause. The call site is [`mount.py` line 618](https://github.com/bit-team/backintime/blob/v1.5.4/common/mount.py#L618), which hardcodes `fusermount` with no fallback to `fusermount3`: ```python subprocess.check_call(['fusermount', '-u', self.currentMountpoint]) ``` The enclosing method is documented at [`mount.py` line 611](https://github.com/bit-team/backintime/blob/v1.5.4/common/mount.py#L611). On distributions that ship only fuse3 or distinquish fuse2 from fuse3 (e.g. NixOS, recent Arch, Debian Bookworm), `fusermount` may not exist or may be the fuse2 binary, while `sshfs` is always the fuse3 variant. On some systems `fusermount` will resolve to the same executable as `fusermount3`, for example on my debian install this is the case. This is not the case for NixOS where both fuse2 and fuse3 are exposed as their actual versions, so an invocation of `fusermount` will be v2 while `fusermount3` would be v3. The fix would be to try `fusermount3 -u` first and fall back to `fusermount -u`, or to detect which is appropriate for the active mount. ## What did you expect to happen? The pre-mount check in the "Manage profiles" dialog completes without error and BackInTime successfully unmounts the temporary test mount. ## Steps to reproduce 1. Install BackInTime on a system where `sshfs` is fuse3-based and `fusermount3` is the available FUSE unmount tool for that version and `fusermount` is provided for the v2 version (e.g. NixOS 25.05). 2. Open "Manage profiles", configure an SSH backup profile with a valid remote host. 3. Click OK / accept the profile. 4. Observe the error: "Unable to unmount sshfs from .../mountpoint". ## `backintime-qt --diagnostics` ```json { "backintime": { "name": "Back In Time", "version": "1.5.4", "running-as-root": false, "latest-config-version": 6, "local-config-file": "NOPE/.config/backintime/config", "local-config-file-found": false, "global-config-file": "/etc/backintime/config", "global-config-file-found": false, "started-from": "/nix/store/NOPE-backintime-common-1.5.4/lib/python3.12/site-packages/backintime/common", "user-callback": "NOPE/.config/backintime/user-callback", "keyring-supported": false }, "host-setup": { "OS": { "/etc/os-release": "NixOS 25.05 (Warbler)", "/etc/lsb-release": "DISTRIB_CODENAME=warbler\nDISTRIB_DESCRIPTION=\"NixOS 25.05 (Warbler)\"\nDISTRIB_ID=nixos\nDISTRIB_RELEASE=\"25.05\"\nLSB_VERSION=\"25.05 (Warbler)\"\n" }, "platform": "Linux-6.18.2-x86_64-with-glibc2.40", "system": "Linux #1-NixOS SMP PREEMPT_DYNAMIC Thu Dec 18 13:03:43 UTC 2025", "display-system": "tty", "locale": "en_AU, UTF-8" }, "python-setup": { "python": "3.12.12 main Oct 9 2025 11:07:00 CPython GCC 14.3.0", "python-executable": "/nix/store/NOPE-python3-3.12.12-env/bin/python3.12", "qt": { "Version": "PyQt 6.9.0 / Qt 6.9.3" } }, "external-programs": { "rsync": "(no rsync)", "ssh": "(no ssh)", "sshfs": "(no sshfs)", "encfs": "(no encfs)", "shell": "/run/current-system/sw/bin/zsh", "shell-version": "zsh 5.9 (x86_64-pc-linux-gnu)" } } ``` Note: `sshfs`, `rsync`, and `ssh` show as absent because `backintime-qt --diagnostics` was run outside the normal GUI session PATH. At runtime (launched from the desktop), `sshfs` 3.7.3 is present and the mount succeeds. This was confirmed by the journal. The problem is solely the unmount step. ## Version information - BackInTime version in nixpkgs: 1.5.4 (tag SHA: `4f6235c2edf7d7a053723d940218ed5f2a3183b8`, nixpkgs: [applications/networking/sync/backintime/common](https://github.com/NixOS/nixpkgs/blob/nixos-25.05/pkgs/applications/networking/sync/backintime/common.nix)) - sshfs version: 3.7.3 (fuse3-based) - fuse2 `fusermount` version: 2.9.9 (present in BackInTime's closure on NixOS) - OS: NixOS 25.05 (Warbler), kernel 6.18.2 ## Additional context The journal sequence that shows the problem: ``` Jun 13 06:47:36 INFO: mount ssh: USER@HOST.DOMAIN:/PATH/TO/backups on .../MOUNTID/mountpoint Jun 13 06:47:36 fusermount: failed to unmount .../MOUNTID/mountpoint: Device or resource busy Jun 13 06:49:00 INFO: Mountpoint .../MOUNTID/mountpoint is already mounted Jun 13 06:49:00 fusermount: failed to unmount .../MOUNTID/mountpoint: Device or resource busy ``` This confirms the mount itself works; only unmount fails. The stale mount persists until the next reboot, so repeated attempts to configure the profile all hit "already mounted" followed by the same unmount failure. The same `fusermount` hardcoding also appears in the unmount path used during actual backups, so this is likely to affect scheduled backups on fuse3-only systems too, not just the profile setup dialog.
5 条评论