You are not logged in.

#1 2024-01-06 05:13:58

gvtc
Member
Registered: 2024-01-03
Posts: 4

Correct mount options to give to NTFS partition for chmod

I have a dualboot Windows/Linux machine and have been attempting for a while now to bind mount several home directories I use on my NTFS windows partition to my Arch home directory so I can keep the file structure consistent.
I've been using the ntfs-3g driver thus far as I have had little success with the new ntfs driver.

However, no matter what options I give to my NTFS mounting configuration, the system refuses to give my user gavin the sufficient permissions to execute programs or modify those permissions with chmod, resulting in errors like this when I try to run a java program, for instance:

[gavin@GAVIN-LAPTOP ChargedUp2023]$ ./gradlew
bash: ./gradlew: Permission denied
[gavin@GAVIN-LAPTOP ChargedUp2023]$ chmod +x gradlew
[gavin@GAVIN-LAPTOP ChargedUp2023]$ ./gradlew
bash: ./gradlew: Permission denied
[gavin@GAVIN-LAPTOP ChargedUp2023]$ 

Here are the current contents of my /etc/fstab config (yes I know it is very messy, it has copy-pasted options from numerous sources):

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p5
UUID=02c759d7-8684-442d-bca7-4f86b4c99a68	/         	ext4      	rw,relatime	0 1

# /dev/nvme0n1p1 LABEL=SYSTEM_DRV
UUID=4E10-3347      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/nvme0n1p3
UUID=D614108D1410732B /run/media/gavin/Windows-SSD ntfs rw,auto,user,users,permissions,fmask=0022,dmask=0000,uid=1000,gid=1000 0 0

# /dev/nvme0n1p6
UUID=81393271-3c43-4e8b-b43e-8551baaa46ed	none      	swap      	defaults  	0 0

/run/media/gavin/Windows-SSD/Users/gavin/Downloads /home/gavin/Downloads none rw,auto,user,users,permissions,fmask=0022,dmask=0000,uid=1000,gid=1000,bind,x-gvfs-hide,nofail 0 0

/run/media/gavin/Windows-SSD/Users/gavin/Documents /home/gavin/Documents none rw,auto,user,users,permissions,fmask=0022,dmask=0000,uid=1000,gid=1000,bind,x-gvfs-hide,nofail 0 0

/run/media/gavin/Windows-SSD/Users/gavin/Pictures /home/gavin/Pictures none rw,auto,user,users,permissions,fmask=0022,dmask=0000,uid=1000,gid=1000,bind,x-gvfs-hide,nofail 0 0

/run/media/gavin/Windows-SSD/Users/gavin/Music /home/gavin/Music none rw,auto,user,users,permissions,fmask=0022,dmask=0000,uid=1000,gid=1000,bind,x-gvfs-hide,nofail 0 0

/run/media/gavin/Windows-SSD/Users/gavin/Videos /home/gavin/Videos none rw,auto,user,users,permissions,fmask=0022,dmask=0000,uid=1000,gid=1000,bind,x-gvfs-hide,nofail 0 0

As well as some of the output of ls -l:

drwxrwxrwx 1 gavin gavin      0 Dec 27 19:13 gradle
-rwxr-xr-x 1 gavin gavin   8428 Jan 14  2023 gradlew
-rwxr-xr-x 1 gavin gavin   2838 Jan 14  2023 gradlew.bat
-rwxr-xr-x 1 gavin gavin 134398 May 21  2023 hs_err_pid34496.log
-rwxr-xr-x 1 gavin gavin 136521 May 21  2023 hs_err_pid54764.log
-rwxr-xr-x 1 gavin gavin      4 Feb 19  2023 networktables.json
-rwxr-xr-x 1 gavin gavin    404 Feb  5  2023 README.md
drwxrwxrwx 1 gavin gavin   4096 Dec 28 09:41 resources

Is there anything I may be setting incorrectly?

Edit: Before you ask, yes I have disabled fast startup on Windows

Last edited by gvtc (2024-01-06 05:23:46)

Offline

#2 2024-01-06 09:23:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: Correct mount options to give to NTFS partition for chmod

https://docs.kernel.org/filesystems/ntfs3.html
You can try to add acl, but will have to get rid of uid, gid, fmask & dmask (and permissions, I guess)

NTFS isn't a posix filesystem, the permissions are mapped/emulated

However, you've the executable bit on the file, the bash permission error is a bit generic and can be vastly misleading.
Are you trying to run a windows batch file? What does gradlew look like?

Offline

#3 2024-01-06 15:46:57

gvtc
Member
Registered: 2024-01-03
Posts: 4

Re: Correct mount options to give to NTFS partition for chmod

seth wrote:

https://docs.kernel.org/filesystems/ntfs3.html
You can try to add acl, but will have to get rid of uid, gid, fmask & dmask (and permissions, I guess)

NTFS isn't a posix filesystem, the permissions are mapped/emulated

However, you've the executable bit on the file, the bash permission error is a bit generic and can be vastly misleading.
Are you trying to run a windows batch file? What does gradlew look like?

gradlew is a bash script I am trying to run. There is a seperate file in the same directory called gradlew.bat for Windows builds, I am not attempting to run that.

To be clear this happens with any runnable file I try to execute within the bind mounted directories.

However, I will try to modify or regenerate the gradlew script to see if it makes any difference.

Offline

#4 2024-01-06 15:49:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: Correct mount options to give to NTFS partition for chmod

Can you "bash gradlew"?

Offline

#5 2024-01-06 15:59:46

gvtc
Member
Registered: 2024-01-03
Posts: 4

Re: Correct mount options to give to NTFS partition for chmod

seth wrote:

Can you "bash gradlew"?

That seems to attempt to run the script, however there's a lot of errors about unknown commands even though the script is supposed to work with any POSIX shell. I'll see if I can attempt to fix the script and come back to you later.

Offline

Board footer

Powered by FluxBB