如何检查当前的默认“mount”选项的“-o defaults”集?

如何检查当前的默认“mount”选项的“-o defaults”集?

man mount描述-o defaults为包括以下一组默认mount选项:rwsuiddevexecautonouserasync

mount系统内核中启用/禁用的选项是否会从-o defaults默认选项集中添加/删除mount?这同样适用于特定于文件系统的默认选项吗?

如何通过检查来检查当前的-o defaults默认选项集?它仅列出所有当前安装的文件系统。mount/proc/mounts

man mount

FILESYSTEM-INDEPENDENT MOUNT OPTIONS
       Some of  these  options  are  only  useful  when  they  appear  in  the
       /etc/fstab file.

       Some  of  these  options could be enabled or disabled by default in the
       system kernel.  To  check  the  current  setting  see  the  options  in
       /proc/mounts.   Note that filesystems also have per-filesystem specific
       default mount options (see for  example  tune2fs  -l  output  for  extN
       filesystems).

        ...

        defaults
          Use  the default options: rw, suid, dev, exec, auto, nouser, and
          async.

          Note that the real set of all default mount options  depends  on
          kernel  and  filesystem type.  See the beginning of this section
          for more details.

答案1

只需检查mount输出?

例如,给定~/tmpfile一个我创建 ext4 文件系统的文件:

~$ sudo mount -t ext4 -o defaults tmpfile /media/cdrom
~$ mount|grep /media/cdrom
tmpfile on /media/cdrom0 type ext4 (rw,relatime)

相关内容