Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to write on sd card #2082

Closed
Yisus7u7 opened this issue May 24, 2021 · 4 comments
Closed

How to write on sd card #2082

Yisus7u7 opened this issue May 24, 2021 · 4 comments

Comments

@Yisus7u7
Copy link

Yisus7u7 commented May 24, 2021

@xeffyr @wmcb-tech

Hello, and accessed my sd card from termux (no root), the sd card supports executables and this would be of great help to me, but termux can not write files on it, gives you permission denied, can I fix it?

Screenshot_20210523-201358

Screenshot_20210523-201717

@agnostic-apollo
Copy link
Member

Writing to external removable sd card and USBs is not officially supported by Android with shell commands and is only supported with SAF. It may work on some devices, but not all. You can't do anything to change that without root.

@ghost
Copy link

ghost commented May 24, 2021

probably it is restricted in read only but with full write access to it's app directory
/storage/1234-5678/Android/data

Normal command line applications won't be able to write in external storage completely but Android apps can have full access into it with full write permissions

You can see more at
https://wiki.termux.com/wiki/Internal_and_external_storage

@Yisus7u7
Copy link
Author

Ok, thank you very much, the sd card if you allow executables, the rare thing is that the application folder (com.termux) does not allow them

@RalfWerner
Copy link

but termux can not write files on it, gives you permission denied, can I fix it?

@Yisus7u7 Access to your external data should be possible by Steps: Deny and Allow in the Android Storage Setup for the Termux app. This is actually made by termux-setup-storage (you've already done), but sometimes does not work, especially with Android 11 devices. Sometimes a reboot also helps to get access to df|grep storage|cut -d% -f2.
Scripts can also be saved on sdcard and run there e.g. with: ln -s /storage/44C4-1B1A/bstart .bashrc or 'bash .bashrc`

@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants