I am trying to run a simple shell script as a root and have angstrom running on the board “Linux beaglebone 3.8.13 #1 SMP Wed Jun 5 11:21:00 CEST 2013 armv7l GNU/Linux”. It always returns following:
root@beaglebone:/media/0472-F4DC# ./bbbgpio.sh
sh: ./bbbgpio.sh: Permission denied
I have tried changing the file permissions and the command succeeds
root@beaglebone:/media/0472-F4DC# chmod -v 777 bbbgpio.sh
mode of `bbbgpio.sh’ changed from 0644 (rw-r–r--) to 0777 (rwxrwxrwx)
but when I try ls -lrt, the permissions remain the same.
-rw-r–r-- 1 root root 1000 Aug 2 2013 bbbgpio.sh
How can I change file permission to make it executable?
Try “chmod a+x bbbgpio.sh” it should make it work.
Thanks Wilfredo, I tried it and copied below is the result. This may be a very silly question and I apologize in advance but is it possible that the Angstrom distributing that I am running has an issue with file permissions?
root@beaglebone:/media/0472-F4DC# ls -lrt
total 32
-rw-r–r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt~
-rw-r–r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt
-rw-r–r-- 1 root root 711 Jan 1 2000 bbbgpio1.py~
-rw-r–r-- 1 root root 712 Jan 1 2000 bbbgpio1.py
-rw-r–r-- 1 root root 150 Jan 1 2000 bbbgpio.txt
-rw-r–r-- 1 root root 729 Jan 1 2000 bbbgpio.py~
-rw-r–r-- 1 root root 711 Jan 1 2000 bbbgpio.py
-rw-r–r-- 1 root root 1000 Aug 2 2013 bbbgpio.sh
root@beaglebone:/media/0472-F4DC# chmod a+x bbbgpio.sh
root@beaglebone:/media/0472-F4DC# ls -lrt
total 32
-rw-r–r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt~
-rw-r–r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt
-rw-r–r-- 1 root root 711 Jan 1 2000 bbbgpio1.py~
-rw-r–r-- 1 root root 712 Jan 1 2000 bbbgpio1.py
-rw-r–r-- 1 root root 150 Jan 1 2000 bbbgpio.txt
-rw-r–r-- 1 root root 729 Jan 1 2000 bbbgpio.py~
-rw-r–r-- 1 root root 711 Jan 1 2000 bbbgpio.py
-rw-r–r-- 1 root root 1000 Aug 2 2013 bbbgpio.sh
root@beaglebone:/media/0472-F4DC# ./bbbgpio.sh
-sh: ./bbbgpio.sh: Permission denied
root@beaglebone:/media/0472-F4DC#
I don’t think the distro has anything to do with not allowing you to change permissions but I may be wrong. I am currently at work but will try to check with my bone when I get home. What distro version are you running?
I don't think the distro has anything to do with not allowing you to change permissions but I may be wrong. I am currently at work but will try to check with my bone when I get
home. What distro version are you running?
Thanks Wilfredo, I tried it and copied below is the result. This may be a very silly question and I apologize in advance but is it possible that the Angstrom distributing that
I am running has an issue with file permissions?
root@beaglebone:/media/0472-F4DC <mailto:root@beaglebone:/media/0472-F4DC># ls -lrt
total 32
-rw-r--r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt~
-rw-r--r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt
-rw-r--r-- 1 root root 711 Jan 1 2000 bbbgpio1.py~
-rw-r--r-- 1 root root 712 Jan 1 2000 bbbgpio1.py
-rw-r--r-- 1 root root 150 Jan 1 2000 bbbgpio.txt
-rw-r--r-- 1 root root 729 Jan 1 2000 bbbgpio.py~
-rw-r--r-- 1 root root 711 Jan 1 2000 bbbgpio.py
-rw-r--r-- 1 root root 1000 Aug 2 2013 bbbgpio.sh
root@beaglebone:/media/0472-F4DC <mailto:root@beaglebone:/media/0472-F4DC># chmod a+x bbbgpio.sh
root@beaglebone:/media/0472-F4DC <mailto:root@beaglebone:/media/0472-F4DC># ls -lrt
total 32
-rw-r--r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt~
-rw-r--r-- 1 root root 150 Jan 1 2000 bbbgpio1.txt
-rw-r--r-- 1 root root 711 Jan 1 2000 bbbgpio1.py~
-rw-r--r-- 1 root root 712 Jan 1 2000 bbbgpio1.py
-rw-r--r-- 1 root root 150 Jan 1 2000 bbbgpio.txt
-rw-r--r-- 1 root root 729 Jan 1 2000 bbbgpio.py~
-rw-r--r-- 1 root root 711 Jan 1 2000 bbbgpio.py
-rw-r--r-- 1 root root 1000 Aug 2 2013 bbbgpio.sh
root@beaglebone:/media/0472-F4DC <mailto:root@beaglebone:/media/0472-F4DC># ./bbbgpio.sh
-sh: ./bbbgpio.sh: Permission denied
root@beaglebone:/media/0472-F4DC <mailto:root@beaglebone:/media/0472-F4DC>#
This is obviously a Windows partition (FAT/VFAT) which does not support execute permission on files.
Wilfredo, thanks for your help. I think that I know what it is (please correct me if I am wrong). The shell script resides on the mounted flash drive which is FAT32. I think that the chmod does not work on the FAT32 FS. The workaround was to run the shell script as “sh bbbgpio.sh”.
Regards
Abid
If it worked than I would say that was your problem. But please give the credit to Gary as he is the one that stated it was due to the partition being fat.