1
1
12rbah2020-12-30 14:53:41
linux
12rbah, 2020-12-30 14:53:41

Why can't I run the executable on a flash drive (ubuntu)?

I'm trying to run the binary on a flash drive, but I get an error, I tried to write chmod +x showFilesAndExtInDir, nothing has changed, I can't even run it as root, what could be the problem?


ls -l for a file (I know I don't have run permission but I can't get it)
-rw-r--r-- 1 us us 2684759 Dec 29 16:15 showFilesAndExtInDir


mistakes
spoiler

I ran the full path (/media/us/Transcend/test_data_for_programs/media/video)
from the folder itself.

if ./showFilesAndExtInDir,
error: bash: ./showFilesAndExtInDir: Permission denied

if: bash ./showFilesAndExtInDir
error: ./showFilesAndExtInDir: ./showFilesAndExtInDir: failed to run binary file

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vaut, 2020-12-30
@12rbah

Your flash drive is most likely FAT32.
FAT32 cannot store attributes, so the X bit is not there and cannot be. As a result, you will not run the binary from it.
Google says that it is possible to set permissions on the entire filesystem when mounted.

S
SquareWheel, 2020-12-30
@SquareWheel

What is it written on? Is there a compiler in the system for this language?

P
pfg21, 2020-12-30
@pfg21

Another option is to mount the flash drive with noexec options
. regardless of other conditions, it is not possible to launch an executable file from this partition.
one of the foolproof options.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question