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

Can't access external storage #1683

Closed
superbonaci opened this issue Aug 3, 2020 · 8 comments
Closed

Can't access external storage #1683

superbonaci opened this issue Aug 3, 2020 · 8 comments

Comments

@superbonaci
Copy link

superbonaci commented Aug 3, 2020

I run termux-setup-storage and waits a couple of seconds and nothing happens. I want to gain access to external microsd which I replaced yesterday. Storage permission is allowed.

  • Termux application version: latest from play store
  • Android OS version: 10
  • Device model: Samsung Galaxy S10
@ghost
Copy link

ghost commented Aug 3, 2020

I want to gain access to external microsd which I replaced yesterday.

Write access isn't possible. https://wiki.termux.com/wiki/Internal_and_external_storage

Look into $HOME/storage for symlinks to Termux private directory on your microsd (should be named external-1).

@ghost ghost closed this as completed Aug 3, 2020
@superbonaci
Copy link
Author

I don't understand why other apps can gain access to external sdcard and Termux can't. Technically is possible, why not implement it?

@ghost
Copy link

ghost commented Aug 3, 2020

Because Termux environment technically is not other apps. Yes, terminal emulator is Android app but command line utilities are Linux apps. CLIs do not have access to Android API, they are executed directly by kernel bypassing the Android framework.

@ghost
Copy link

ghost commented Aug 3, 2020

Technically is possible, why not implement it?

Possible, bot wontfix. Why?

  • Each package has to be patched: we will need to rework the I/O completely in order to redirect it through JNI to the Android API methods.
  • This will require lots of work. I personally do not want to make all packages use the JNI and will not bother to maintain that.
  • There will be issues and performance loss.

@superbonaci
Copy link
Author

Ok I understand. I was trying to run some Go programs on external sd, but I see will not be possible in the near future.

@ghost
Copy link

ghost commented Aug 3, 2020

Even if external sd would be writable, you won't be able to execute any programs (except scripts) from it anyway. All kinds of storage (except /system and /data) are mounted with noexec, effectively disabling program execution on them.

@superbonaci
Copy link
Author

Ok I understand. What happens if I have LineageOS rooted with Magisk? Could I use Termux more broadly?

@ghost
Copy link

ghost commented Aug 3, 2020

With root you will have at least read-write access on external sdcard. You can try to remount it with "exec" option to enable execution, not sure whether sdcardfs daemon will handle it properly.

@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
This issue was closed.
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

1 participant