将 mount 命令转换为 fstab

将 mount 命令转换为 fstab

我如何将这些命令转换为 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挂载条目/withrprivate
  • tmpfs为挂载添加新的挂载条目

(我认为你的/bin/mount --bind /with /with打字错误?)

从未尝试过,但也许有效。

相关内容