Linux的/etc/mtab文件

manual 中的信息
When mounting a filesystem mentioned in fstab or mtab, it suffices to specify on the command line only the device, or only the mount point.

The programs mount and umount traditionally maintained a list of currently mounted filesystems in the file /etc/mtab. The support for regular classic /etc/mtab is completely disabled in compile time by default, because on current Linux systems it is better to make it a symlink to /proc/mounts instead. The regular mtab file maintained in userspace cannot reliably work with namespaces, containers and other advanced Linux features. If the regular mtab support is enabled than it’s possible to use the file as well as the symlink.

机器翻译如下: 

当挂载fstab或mtab中提到的文件系统时,只需在命令行上指定设备或挂载点即可。

程序mount和umount传统上在文件/etc/mtab中维护当前安装的文件系统列表。默认情况下,对常规classic/etc/mtab的支持在编译时完全禁用,因为在当前的Linux系统上,最好将其设置为指向/proc/mounts的符号链接。用户空间中维护的常规mtab文件不能可靠地与名称空间、容器和其他高级Linux功能一起工作。如果启用了常规mtab支持,则可以使用文件和符号链接。

主要意思: 

mount 与 unmount 程序使用 /etc/mtab 维护当前已经挂载的文件系统列表
linux 系统将 /etc/mtab 设定为一个指向 /proc/self/mounts 的链接文件而非普通文件

 图片截取自CentOS Linux release 7.5.1804 (Core

以前的 /etc/mtab 用户态文件管理方式不能与命名空间、容器及其他 linux 高级特性很好的合作

简单理解: 

linux 的 /etc/fstab  开机启动时读取挂载配置
linux 的 /etc/mtab  系统运行时的实时信息


 


 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值