Whenever I create or copy few shell files to usb storage device, then I am not able to make them executable.
If I create test.sh, it's default file permission will be 644, but when I execute
chmod 777 test.sh
no error reports and echo $?
also returns "0". But still ls -l
shows permission as 644
and I can not execute it as ./test.sh
Best Answer
Yes, this can occur if your device is formatted with a filesystem that does not support that kind of permission setting, such as VFAT. In those cases, the umask is made up on the fly from a setting in the fstab (or the hotplugging equivalent).
See, most probably, man mount for details. For example, for VFAT, we find:
etc.