Score:0

gcsfuse mount with fstab fail to apply 'exec' option

ki flag

I've mounted gcp bucket with gcsfuse by fstab file. To ellow execution of scripts and executable from the bucket, added option of 'exec' to the options in the fstab file. Yet, this option isn't applied.

The fstab line:

bucketname /mount-point gcsfuse rw,uid=1001,gid=1002,file_mode=777,dir_mode=777,exec,user,allow_other,_netdev

The bucket is mounted, and i can read, write and modify files within the bucket. But when i'm trying to execute something, i get 'Permission denied'.

So, unmount the bucket and try to see what is going on with 'mount -a':

user@server:/$ sudo mount -a
Calling gcsfuse with arguments: -o noexec -o nodev --gid 1002 --file-mode 777 --dir-mode 777 -o allow_other -o rw -o nosuid --uid 1001 bucketname /mount-point
I0611 08:33:06.783746 2023/06/11 08:33:06.783723 Start gcsfuse/0.42.5 (Go version go1.20.3) for app "" using mount point: /mount-point

As you can see, although the option 'exec' in the fstab options, gcsfuse still using default option 'noexec'. I can allow execution only by the command:

sudo gcsfuse -file-mode=777 -dir-mode=777 -o rw -o exec -o allow_other bucketname /mount-point

OfCourse, after restart the problem will return, and I'll have to unmount the bucket and use this command manually again. I need to find the way to let the fstab line work properly.

Score:0
tc flag

This is not a GCSFuse issue. I was able to fix this by using user as the first option in the fstab entry.

bucketname /mount-point gcsfuse user,rw,uid=1001,gid=1002,file_mode=777,dir_mode=777,exec,allow_other,_netdev

This is because the user option implies the options noexec, nosuid, and nodev unless explicitly overridden by subsequent options.

Please refer to the documentation [here][1].

Thanks,
Ashmeen

[1]: https://man7.org/linux/man-pages/man8/mount.8.html#:~:text=user%0A%20%20%20%20%20%20%20%20%20%20%20Allow%20an,dev%2Csuid)

yosisviva avatar
ki flag
Many Thanks. you've helped me a Lote!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.