小编Ken*_*uda的帖子

为什么在使用 ENOENT 取消链接失败后绑定挂载文件?

我不明白为什么在取消链接后绑定安装时会出现 ENOENT:

kduda@penguin:/tmp$ echo hello > a
kduda@penguin:/tmp$ touch b c
kduda@penguin:/tmp$ sudo unshare -m
root@penguin:/tmp# mount -B a b
root@penguin:/tmp# rm a
root@penguin:/tmp# cat b
hello
root@penguin:/tmp# mount -B b c
mount: mount(2) failed: No such file or directory
Run Code Online (Sandbox Code Playgroud)

这对我来说似乎是一个错误。您甚至可以重新创建“a”,指向相同的 inode,但您会得到相同的结果:

kduda@penguin:/tmp$ echo hello > a
kduda@penguin:/tmp$ ln a a-save
kduda@penguin:/tmp$ sudo unshare -m
root@penguin:/tmp# mount -B a b
root@penguin:/tmp# rm a
root@penguin:/tmp# ln a-save a
root@penguin:/tmp# mount -B b c
mount: mount(2) failed: No such file or directory …
Run Code Online (Sandbox Code Playgroud)

linux bind-mount

4
推荐指数
2
解决办法
696
查看次数

标签 统计

bind-mount ×1

linux ×1