我正在尝试实现 FUSE 文件系统。我收到此错误:
cannot access MountDir: Transport endpoint is not connected
这是程序的相关部分。有两个目录,MirrorDir
和 MountDir
,它们与所有代码位于同一目录中。我这样调用程序:
./myFS -o nonempty -o allow_other MirrorDir MountDir
谁能看出我做错了什么?
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;
}
最佳答案
这通常是由于文件系统崩溃而导致挂载目录挂载。进入挂载点的父目录,输入fusermount -u YOUR_MNT_DIR
。
如果这不起作用,请执行 sudo umount -l YOUR_MNT_DIR
。
关于linux - fuse 错误 : Transport endpoint is not connected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16002539/