2

I try to execute chmod on a file with Termux, but it sends back an error which I'm unable to solve.
My phone is not rooted. If you can help me I would be most grateful to you for this! Here is the command and the error:

$ chmod +x /sdcard/meta-install.sh
chmod: changing permissions of 'meta-install.sh': Operation not permitted

Thanks!

Irfan Latif
  • 20,353
  • 3
  • 70
  • 213
ARK
  • 21
  • 1
  • 1
  • 3

2 Answers2

3

Android does not allow you to create executable files within the sdcard (internal storage, mounted in userspace) partition without root.

A workaround would be to execute the file as bash meta-install.sh, assuming it is a bash file. (Alternatively sh meta-install.sh to run it using sh as the shell).

confetti
  • 602
  • 4
  • 11
  • 24
1

Filesystem on Android's internal memory (called External Storage) is SDCardFS (successor of FUSE) which imposes a mask mode (fix permissions) on all files and directories. It's an emulated/virtual filesystem, not the real one. You can only change permissions with chmod from /data/media/ which is the real filesystem (ext4 or f2fs). But /data/media/ is only accessible to root user.

Further Reading:

Related:

Irfan Latif
  • 20,353
  • 3
  • 70
  • 213