Score:0

Unable to execute a compiled executable file on a mounted hard drive

rs flag

I have a file that I compiled to an executable but when I attempt to run it with ./main, it says permission denied. I used to have no problem executing files from this drive. I have deleted the file and recompiled it. If I run ls -la I see that root owns it and it has executable permissions.

I attempt to run it with sudo ./main and for some reason permission is still denied.

The partition is NTFS because I share it with my Windows partition.

I tried running a basic game executable that I made in Unity game engine. It ran with no issues. There only seems to be a problem with this file.

EDIT:

Thanks to one of the commenters for giving me this link: How do I use 'chmod' on an NTFS (or FAT32) partition? I added the exec option, and I was able to run my program. I did not check in with this problem earlier because it resolved itself temporarily for some unknown reason. It came back, so I was glad I had these responses to help me. Thanks!

Pilot6 avatar
cn flag
So "this" file doesn't run, but "that" file does? Is this the question?
sudodus avatar
jp flag
It is rather common, that Linux mounts Microsoft file systems without execute permissions for files located there [for security reasons]. This can be modified, see Example 2 at [this link](https://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition/956072#956072).
ru flag
The file that does work, is it on your Linux partition or your NTFS partition? Refer to sudodus' comment for the reason I ask this
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.