Pages

Topics

Tools

↑↓navigate↵openescclose
All guides

Linux: Transport endpoint is not connected on FUSE mounts

A FUSE daemon died and left the mount behind. Unmount with fusermount -uz, then fix the cause: network drops, OOM kills, or a restarted container.

~5 min readLinux
#Linux#FUSE#Mounts#Troubleshooting
A Linux mount point crate with a severed cyan daemon link, an amber unmount lever beside it

Introduction & Quick Summary

text
$ ls /mnt/remote ls: cannot access '/mnt/remote': Transport endpoint is not connected $ df -h /mnt/remote df: /mnt/remote: Transport endpoint is not connected

This is ENOTCONN from the kernel's view of a FUSE mount whose userspace daemon is gone. The mount point still exists in the mount table, but the process that answered file operations has exited or stopped responding, so every stat, read and write fails immediately. The filesystem is not corrupt; the connection between kernel and daemon is.

Recovery is two steps, in this order:

bash
fusermount -uz /mnt/remote # unmount even if busy mount | grep /mnt/remote # confirm it is gone

Then find out why the daemon died before remounting, or the same failure returns:

bash
journalctl -u mnt-remote.mount --no-pager -n 50 journalctl -k --since "1 hour ago" | grep -i fuse dmesg | tail -20

The four usual causes: a network drop that killed sshfs, an rclone/s3fs/gcsfuse process killed by the OOM killer, a container restart that orphaned a bind-mounted FUSE directory, and a daemon that crashed on a malformed response from the remote.

Mount typeDaemonTypical death
sshfssshfsSSH connection reset, laptop sleep
rclone mountrcloneOOM kill, API auth expiry
s3fs / gcsfuses3fs / gcsfuseCredential expiry, throttling
fusermount3 testany FUSE programCrash of the backing binary
squashfuse, appimagehelperFailed extraction on read

Core Mechanics, Signatures & Reproducible Setup

A FUSE mount is a contract between the kernel VFS and a daemon: the kernel forwards file operations over /dev/fuse, the daemon answers, and the kernel converts the answer into a result or an errno. When the daemon exits, the kernel marks the connection aborted; operations return ENOTCONN rather than EIO, which is why ls says "Transport endpoint is not connected" instead of "Input/output error".

The mount entry stays until something unmounts it. That is deliberate: unmounting implicitly would hide the fact that data may be pending.

Reproduce it with any FUSE program, for example a loopback bind mount:

bash
mkdir -p /tmp/src /tmp/dst bindfs /tmp/src /tmp/dst ls /tmp/dst # works pkill -9 bindfs ls /tmp/dst # ls: cannot access '/tmp/dst': Transport endpoint is not connected
bash
umount /tmp/dst # umount: /tmp/dst: target is busy. (when a shell is cd'd into it) fusermount -uz /tmp/dst mount | grep /tmp/dst || echo "unmounted"

-u unmounts, -z is lazy: it detaches the mount immediately and cleans up once the last reference goes away. That is what makes -uz the reliable form when a process holds the directory.

Key Comparison Table

CommandNeeds rootWorks when busyRemoves mount entry
fusermount -u <dir>NoNoYes
fusermount -uz <dir>NoYesYes
umount <dir>UsuallyNoYes
umount -l <dir>YesYes (detaches)Yes
umount -f <dir>YesSometimesYes
Recurrence causeEvidencePrevention
Network flapssh exit 255 in logsServerAliveInterval, reconnect
OOM killdmesg shows Out of memory: Killed process--vfs-cache-mode, memory limits
Container restartNew container, same bind pathMount inside the container or use a sidecar
Auth expiry403/401 in daemon logLong-lived credentials, refresh token
Kernel fuse limitfuse: too many connsUnmount stale entries

Practical Edge Cases, Error Fixes & Deep Dive Code Examples

Case 1: sshfs after a network drop

bash
sshfs user@host:/data /mnt/remote # network drops, then ls /mnt/remote # Transport endpoint is not connected

Remount with keepalive and reconnect so a short outage does not become a dead mount:

bash
fusermount -uz /mnt/remote sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 \ user@host:/data /mnt/remote

reconnect retries operations after a disconnect; the keepalive pair detects a dead TCP connection in about 45 seconds instead of waiting for a kernel timeout. Neither option survives the daemon exiting, so pair it with a systemd unit that restarts on failure.

Case 2: rclone mount killed by the OOM killer

bash
dmesg | grep -i -E 'killed process|out of memory' | tail -5 # Out of memory: Killed process 8123 (rclone) total-vm:1.9GiB

Streaming mode keeps memory low but buffers can grow on large directory listings. Bound memory and let systemd restart it:

ini
# /etc/systemd/system/mnt-cloud.mount is not what you want here; use a service [Unit] Description=rclone mount for cloud bucket After=network-online.target Wants=network-online.target [Service] Type=notify ExecStart=/usr/bin/rclone mount cloud:bucket /mnt/cloud \ --vfs-cache-mode writes --vfs-cache-max-size 2G --vfs-read-ahead 32M ExecStop=/bin/fusermount -uz /mnt/cloud Restart=on-failure RestartSec=10s MemoryMax=1G [Install] WantedBy=multi-user.target

--vfs-cache-mode writes costs disk but removes a whole class of ENOTCONN failures caused by writes racing a dead connection.

Case 3: The mount is inside a container

A host FUSE mount bind-mounted into a container stops working when the host daemon dies; the container sees the same ENOTCONN and cannot fix it from inside — it has no fusermount and no permission to unmount.

bash
docker inspect -f '{{range .Mounts}}{{.Source}} -> {{.Destination}}{{"\n"}}{{end}}' api

Three workable patterns, in order of preference: run the FUSE client inside the container, run it as a sidecar sharing a volume, or restart the container after the host remounts. --device /dev/fuse --cap-add SYS_ADMIN inside a container is a security decision, not a workaround to apply casually.

Case 4: umount says the target is busy

bash
fuser -mv /mnt/remote # which processes hold it lsof +D /mnt/remote 2>/dev/null | head

Shells with cwd inside the mount, editor swap files and tail -f are the usual holders. Rather than chasing every one, lazy-unmount:

bash
fusermount -uz /mnt/remote

-uz detaches immediately; the old mount disappears from new lookups and the holders fail on their next access. Do not run it while a process is mid-write to data you care about.

Case 5: It comes back on every boot

/etc/fstab entries for FUSE filesystems that fail at boot leave a stale mount point that later produces ENOTCONN. Automount it instead, so the first access mounts it:

fstab
user@host:/data /mnt/remote fuse.sshfs _netdev,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,IdentityFile=/home/user/.ssh/id_ed25519,x-systemd.automount,x-systemd.idle-timeout=300 0 0

_netdev orders the mount after the network; x-systemd.automount creates a systemd automount unit that mounts on access and can be restarted independently of boot.

Case 6: Not a FUSE mount at all

ENOTCONN on a network filesystem can also come from a CIFS mount whose server dropped the session, or from a Unix socket path used as a directory argument by mistake. Confirm what is actually mounted before unmounting:

bash
findmnt -T /mnt/remote -o TARGET,SOURCE,FSTYPE,OPTIONS

If FSTYPE is cifs or nfs4, use mount -o remount /mnt/remote or umount -f and address the server side; fusermount will report that the path is not a FUSE mount.

Common Compilation/Runtime Mistakes & Version Gotchas

  • rm -rf on the mount point. It deletes nothing under the broken mount and everything under the directory once the mount is gone; unmount first.
  • Recreating the directory instead of unmounting. rmdir fails with Device or resource busy and the stale entry remains.
  • fusermount missing in minimal images. fusermount3 is the current binary on distros with fuse3; scripts that call fusermount fail on those images.
  • Unmounting from inside the mount. cd out first, or -z does nothing useful because the shell itself keeps the reference.
  • Treating it as disk corruption. fsck on a FUSE path does not apply; the daemon is the failing component.
  • Kernel log noise after a crash. fuse: bad page write or fuse: aborting lines in dmesg are normal fallout of a daemon exit, not a separate bug.

Schedule a health check that remounts a flaky mount with the cron builder, and parse dmesg or daemon logs with the regex tester to find the process that died before the mount did. When you need to fix permissions on the backing directory, the chmod reference gives the numeric modes.

Primary references: fusermount3(1) documents -u and the lazy -z option, and mount(8) covers -o remount, lazy unmounts and _netdev.

Official references

primary documentation

The Linux documentation that defines the behaviour this guide explains.

Try matching browser tools

All tools

Small utilities that fit Linux work — they run entirely in this browser tab, so nothing you paste leaves your device.

All Linux guides

More in Linux

All Linux guides

The guides filed next to this one in Linux, in library order.