You are not logged in.

#1 2023-01-03 12:03:18

mutex
Member
Registered: 2023-01-03
Posts: 6

[SOLVED] /etc/fstab not functioning as expected, exec flag

solved.

d.ALT wrote:
/dev/sdb1 /drive2 ext4 defaults

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).

(https://man.archlinux.org/man/mount.8.en)


Hello
I am mounting a secondary drive at /drive2
mounting through fstab doesn't let me execute any files on the drive, despite me setting the exec flag.

 
UUID=010b7269-342e-46cd-aea5-7301758d774f	/         	ext4      	rw,relatime	0 1
UUID=BC1E-F36D      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2
/dev/sdb1 /drive2 ext4 exec,rw,user, 0 0 # This is the drive I need help with!, Exec flag is set.
zsh: permission denied: ./compile.sh
-rwxr-xr-x 1 mutex mutex   92 Dec 31 23:07 compile.sh

The following command works fine, Executing files works.

 sudo mount -o exec /dev/sdb1 /drive2 

But I need to run it every system start.

EDIT: Sorry, More information I forgot to add

 
$ cat /proc/mounts | grep drive2                                                             130 ↵
/dev/sdb1 /drive2 ext4 rw,nosuid,nodev,noexec,relatime 0 0

Last edited by mutex (2023-01-03 12:27:45)

Offline

#2 2023-01-03 12:20:59

d.ALT
Member
Registered: 2019-05-10
Posts: 959

Re: [SOLVED] /etc/fstab not functioning as expected, exec flag

/dev/sdb1 /drive2 ext4 defaults

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).

(https://man.archlinux.org/man/mount.8.en)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#3 2023-01-03 12:24:09

mutex
Member
Registered: 2023-01-03
Posts: 6

Re: [SOLVED] /etc/fstab not functioning as expected, exec flag

d.ALT wrote:
/dev/sdb1 /drive2 ext4 defaults

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).

(https://man.archlinux.org/man/mount.8.en)

Thank you, I didn't know I had to override it afterwards.
I'll restart my computer and mark it as solved.

Offline

Board footer

Powered by FluxBB