“dependency failed”表示当前mount单元依赖的某个单元(如remote-fs.target、另一.mount单元或.service)处于failed或inactive状态;需通过systemctl status查看“Dependency failed on”行定位具体故障单元,并检查其状态与日志。
systemd mount 单元报 “dependency failed” 是什么在阻塞?
这通常不是 mount 本身出错,而是它依赖的某个单元(比如 local-fs.target、remote-fs.target、另一个 .mount 单元,或某个 .service)处于 failed 或 inactive 状态,导致 systemd 拒绝启动当前 mount 单元。
关键要看 systemctl status your-mount.mount 输出中 “Loaded” 和 “Active” 下方的 “Dependency failed on” 行,以及紧接着的 “See ‘systemctl status …’ for details” 提示——那个被提到的单元才是真正的故障源。
怎么快速定位是哪个依赖挂了?
运行 systemctl status your-mount.mount 后,重点检查以下三处:
- “Loaded” 行末尾括号里的路径,确认你编辑的是正确的单元文件(比如
/etc/systemd/system/mnt-data.mount) - “Active” 行下方是否明确写了类似
Dependency failed on mnt-nfs-server.mount或Dependency failed on network-online.target - “Unit” 段落末尾的
Also:列表,它显示该 mount 单元隐式依赖哪些 target;若其中某个 target 处于inactive(如remote-fs.target),而你的挂载又需要网络,就可能卡住
然后立刻执行 systemctl status 加上那个被点名的单元名,例如 systemctl status mnt-nfs-server.mount,看它的真实错误。