Failed to execute compiled files - bash: ./ a.out: Permission denied. (I tried chmod)

I compiled my C source with cc test.c, and it generated a file a.out.

However, when I run it, I get this error -

bash: ./a.out: Permission denied

My source is not in the home directory, it is on another FAT-32 partition, so I installed a disk on which the code uses the following command -

$ udisks --mount /dev/sda7 --mount-options umask=022
Mounted /org/freedesktop/UDisks/devices/sda7 at /media/48E9-FD53
$ cd /media/48E9-FD53/C

Then I compile my code with cc

I also tried gcc. But still I get the same error.

Then I did - chmod +x a.outall the same problem. Also with ( chmod 755 a.out) and chmod u+x a.out.

I also tried to compile and execute the program with sudo.

I also tried - sudo chown sannidhya:sannidhya a.out.

, googling, .

.out ( )?

. Ubuntu 12.04 LTS.

, chmod +x a.out, - ls -l a.out, -

-rw-r--r-- 1

, a.out, , Allow executing file as program, .

+5
2

, no-exec. :

sudo mount -o remount -o exec /dev/sda7
+8

, NTFS/FAT, , , . chmod .

ext4 ( linux), .


NTFS/FAT . ,

sudo umount /mnt/my_partition
sudo mount -t vfat -o rw,auto,user,fmask=0000,dmask=0000 /dev/sda7 /mnt/my_partition

777 (eeeek!), .

+3

All Articles