您的位置:首页 > 运维架构 > Linux

/etc/mtab must be a symlink to /proc/mounts

2013-08-04 00:00 429 查看
With linux >= 2.6.26, /proc/mounts contains all of the information in
/etc/mtab, plus more.  The mount system call can now pass all of the mount
options to the kernel, so no information is missing in /proc/mounts.  This
has obviously useful benefits such as read-only root, and the state in
/etc/mtab never gets out of sync with reality (there are a number of open
bugs against mount where this occurs).

Additionally, with the addition of per-process namespaces with CLONE_NEWNS to
clone(2), each process has its own set of mounts, and as such a system-wide
/etc/mtab is useless: it's only valid in one of the potentially many
namespaces and can quickly get into a horrible mess.  At this point,
/etc/mtab *must* be a symlink to avoid breakage.  Note that /proc/mounts is
now a symlink to /proc/self/mounts for this reason: each process has
potentially different mounts.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐