82

I'm trying to implement the FUSE filesystem. I am receiving this error:

cannot access MountDir: Transport endpoint is not connected

This the relevant parts of the program. There are two directories, MirrorDir and MountDir, that exist withing the same directory as all of the code. I am calling the program like this:

./myFS -o nonempty -o allow_other MirrorDir MountDir

Can anyone see what I am doing wrong?

static struct fuse_operations xmp_oper = {
    .getattr    = xmp_getattr,
    .readdir    = xmp_readdir,
    .open       = xmp_open,
    .read       = xmp_read,
};

int main(int argc, char *argv[]) {
    int fuse_stat;
    char* mirrorDir;

    mirrorDir = malloc(sizeof(strlen(argv[argc-2]+1)));
    if (mirrorDir == NULL) {
        perror("main calloc");
        abort();
    }

    // Pull the rootdir out of the argument list and save it in my internal data
    mirrorDir = realpath(argv[argc-2], NULL);

    argv[argc-2] = argv[argc-1];
    argv[argc-1] = NULL;
    argc--;

    // turn over control to fuse
    fprintf(stderr, "about to call fuse_main\n");   
    fuse_stat = fuse_main(argc, argv, &xmp_oper, mirrorDir);
    fprintf(stderr, "fuse_main returned %d\n", fuse_stat);
    return fuse_stat;
}
Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
AndroidDev
  • 20,466
  • 42
  • 148
  • 239

6 Answers6

172

This typically is caused by the mount directory being left mounted due to a crash of your filesystem. Go to the parent directory of the mount point and enter fusermount -u YOUR_MNT_DIR.

If this doesn't do the trick, do sudo umount -l YOUR_MNT_DIR.

Tanner Semerad
  • 12,472
  • 12
  • 40
  • 49
Jonathan Brown
  • 3,644
  • 3
  • 25
  • 31
  • 5
    I had to sudo umount to get it to work. fusermount gave me: entry for not found in /etc/mtab – Christian Bongiorno Jun 12 '16 at 06:41
  • 1
    `fusermount -u` did not work in my case, so i tried `sudo umount -l` but I get this error message: `umount: MOUNT_DIR: block devices not permitted on fs` Any ideas? – feedc0de Sep 21 '17 at 07:19
  • 2
    Likewise, it was the second suggestion which worked for me. – otocan Feb 22 '18 at 08:55
  • 2
    Likewise as well. `sudo umount -l YOUR_MNT_DIR` worked for me. I was using root user, which I got on with `su -`. Thank you so much :) – Joyoyoyoyoyo Nov 12 '18 at 02:21
  • `umount -l` also worked for me after receiving the access error `Transport endpoint is not connected` and umount on its own complaining `Device or resource busy`. – Paul Feb 16 '20 at 17:16
  • 3
    For me only `fusermount -uz YOUR_MNT_DIR` worked (notice the extra `z`) – farkas Jul 23 '20 at 07:37
  • This alone (the -l option) worked for me when rclone lost authorization and wouldn't re-mount in the same dir due to Transport endpoint not connected and fuser/umount not working. Thanks! – Dan Jul 15 '21 at 05:13
  • Comment / solution from @farkas did solved my problem – alneven Dec 26 '22 at 19:27
24

I mounted a ssh file system (sshfs command line) and left it mounted and I had same problem, fusermount -u YOUR_MNT_DIR solved my problem. Thanks

aldoWan
  • 93
  • 1
  • 6
1

In Azure, I tried to mount my container using user managed identities. I kept getting Transport endpoint is not connected until the Storage Blob Data Contributor permission was added to the managed identity.

hpaknia
  • 2,769
  • 4
  • 34
  • 63
0

You may check your /etc/hosts to verify it the master node is with a fully qualified name. More details in https://community.cloudera.com/t5/CDH-Manual-Installation/Setting-the-NameNode-port-8020-to-listen-outside-of-localhost/td-p/2257 and in How to configure hosts file for Hadoop ecosystem

Community
  • 1
  • 1
Thiago Mata
  • 2,825
  • 33
  • 32
0

I encountered this problem like "Transport endpoint is not connected" or "Permission denied" when I use rclone to mount Microsoft OneDrive to a Ubuntu system. I am a normal user of the system, so by default my home directory is accessible only to me. When I created the mountpoint directory, it is also accessible only to me. The rclone forum moderator just misled me to wrong directions and finally rudely closed my question when he realized he was unable to answer, so I have to solve the problem myself. After days' of investigation, I finally figure out that these error messages are related to the file access privilege mode. Since I am a normal user but fusermount runs as root, it cannot access the mountpoint directory while mounting, and cannot access my home directory while unmounting, so it complaints. The solution is very simple: open the file access privilege of both the mountpoint directory and home directory to everyone by setting their mode bits to 777.

zzzhhh
  • 291
  • 3
  • 10
0

This may help someone.

A file with unreadable characters from a Windows box temporarily gave me this endpoint not connected error on an external USB drive each time I attempted to read it. I could unmount and re-mount the drive to wake things up, but accessing that file (or even the directory containing it) re-broke things.

I connected the drive to a different computer and renamed the file to resolve.


Details

I spent a couple late-night hours lazily browsing Wikipedia and downloading the better pics to my Microsoft Surface (Win10); some had Asian and Cyrillic characters.

Not my image, but more or less this:

Asian and Cyrillic filename characters

Today I used pscp -r -p to push the directory to my Linux Mint box--but pscp threw errors on several files. I don't explicitly recall verbatim, but this is very close if not the same: https://superuser.com/questions/769385/pscp-and-utf-8-characters

"user@remote_host:/Справочник/file.txt" "E:\Справочник\file.txt"
scp: E:/??????????/file.txt: Cannot create file

Back at my Linux box, trying to access the directory got me the Transport endpoint is not connected error. Then the entire drive became unusable--both in thunar file manager and at the CLI, with errors like "cannot get working directory" and other problems we'd expect with a damaged filesystem.

The fusermount command got me nowhere, but sudo umount -l worked several times.

Each time I un-and-re-mounted this drive (formatted exFAT), everything reverted to normal (read/write/delete worked as expected)--until I attempted to read/rename/remove the directory with the unreadable (UTF-8?) characters, at which point the entire drive again became inaccessible.

I connected the drive to the WinBox and renamed the files--all better.

I could probably add a character set support, but this was the first time in 20 years I've encountered this, so I doubt I'll bother.

Jonathan Brown's answer helped me diagnose this and conclude that the simple solution of carrying the drive upstairs could be the fix.

Thanks Jonathan!

zedmelon
  • 373
  • 2
  • 10