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

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

我有一个分区被挂载为noexec。它显示在mount输出中,但没有任何内容fstab可以执行此操作。

从哪里来的noexec

我的 fstab:

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

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

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

答案1

默认值确实是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).

相关内容