分区被挂载为 noexec,而不是 fstab,还能是什么?

gcb*_*gcb 3 linux mount partitioning ext4

我有一个分区被安装为noexec. 它显示在mount输出上,但没有任何东西fstab可以做到这一点。

是从哪里来noexec的?

我的文件系统表:

UUID=1fbb29fe-cef2-4cc2-9b1e-ac45e74289ac /               ext4    noatime,nodiratime,errors=remount-ro 0       1
# swap was on /dev/sda3 during installation
UUID=some-uuid-string none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

tmpfs   /tmp         tmpfs   nodev,nosuid,noexec,size=2G          0  0

# old disks
#/dev/md0     /DATA  ext4   noauto,nodiratime,errors=remount-ro,user 0 2
# new disks:
/dev/md1     /DATA  ext4   noauto,nodiratime,errors=remount-ro,user 0 2
Run Code Online (Sandbox Code Playgroud)

我以用户或 root 身份挂载上面的 /DATA 分区。无论哪种情况我都会得到:

/dev/md1 on /DATA type ext4 (rw,nosuid,nodev,noexec,nodiratime,relatime,errors=remount-ro,stripe=16384,data=ordered,user)
Run Code Online (Sandbox Code Playgroud)

nKn*_*nKn 6

默认值确实是exec,但使用该user选项意味着以下选项:

  • 不执行
  • 诺苏伊德
  • 诺德夫

正如中所解释的man mount

   user   Allow an ordinary user to mount the filesystem.  The name of the
          mounting user is written to the mtab file  (or  to  the  private
          libmount  file  in /run/mount on systems without a regular mtab)
          so that this same user can unmount the filesystem  again.   This
          option  implies  the  options  noexec, nosuid, and nodev (unless
          overridden  by  subsequent  options,  as  in  the  option   line
          user,exec,dev,suid).
Run Code Online (Sandbox Code Playgroud)