我如何将这些命令转换为 fstab?
/bin/mount --make-rshared /
/bin/mount --bind /with /with
/bin/mount --make-rprivate /with
/bin/mount -t tmpfs company-with-global /with
答案1
的手册页mount
在有关 的章节中说shared subtree operations
:
Since util-linux 2.23 the mount command allows to use several propagation flags together and also together with other mount operations. This feature is EXPERIMENTAL. The propaga‐
tion flags are applied by additional mount(2) syscalls when the preceding mount operations were successful. Note that this use case is not atomic. It is possible to specify the
propagation flags in fstab(5) as mount options (private, slave, shared, unbindable, rprivate, rslave, rshared, runbindable).
这意味着:
- 将选项添加
rshared
到安装选项中/
- 使用选项添加新的
bind
挂载条目/with
rprivate
tmpfs
为挂载添加新的挂载条目
(我认为你的/bin/mount --bind /with /with
打字错误?)
从未尝试过,但也许有效。