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



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).

  • Thank you, great advice.
    – Pasha
    Dec 19 '20 at 1:53

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:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.