在CentOS/RHEL 7中使用rm命令报错:Function not implemented

总结

从 /dev/fuse 挂载到 /root/.cache/doc 由用户进程 /usr/libexec/xdg-document-portal 管理。
如果用户想删除目录,他们可能需要优雅地停止此过程,然后卸载 /root/.cache/doc。

问题

某些用户目录无法删除。
例如:

/root/.cache/doc/ directory
/root/.cache/doc/by-app directory

如果我们尝试删除该目录,则会出现以下错误:

# rm -rf /root/.cache/doc/
rm: cannot remove 'doc/by-app': Function not implemented
之路教程 https://onitr oad .com

解决方案

这些目录是 /dev/fuse 设备的挂载点。

# mount
--mount (ext, ocfs2, nfs, gfs, fuse, cifs, btrfs, xfs)
/dev/fuse on /root/.cache/doc type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
# df
/dev/fuse 0 0 0 - /root/.cache/doc

我们可以看到以下用户进程 xdg-docum 正在使用 /root/.cache/doc 。

# lsof -b M -n -l -c|grep -i fuse
xdg-docum 2222 0 mem REG 252,0 259336 67222590 /usr/lib64/libfuse.so.2.9.4
xdg-docum 2222 0 7u CHR 10,229 0t0 24701 /dev/fuse
# cat ps|grep -i xdg-docum
root 2222 0.0 0.0 590816 4860 ? Sl Jan1 0:00 /usr/libexec/xdg-document-portal
日期:2020-09-17 00:12:43 来源:oir作者:oir