I ran 'termux-setup-storage' when I had a bad sd-card (I'm assuming this is the issue). Now (with a new, working sdcard) '/sdcard' points to local storage. I attempted to run 'termux-setup-storage' again but 'sdcard' still points to local storage. I'm running Android 7.1.1
/sdcard always points to internal storage, it is unrelated to termux. After running termux-setup-storage you have a folder ~/storage which contains symlinks to internal storage (~/storage/shared), sd card (~/storage/external-1) and some other places. Run ls -l ~/storage/ to see where the symlinks point.
all sym links point to (->): '/storage/emulated/0' sub-directories which are located in internal storage. I see no '~/storage/external-1'
I had to create the sdcard folder and symlink manually. The actual path depends on which system you have. For me, it was /storage/external_SD/Android/data/com.termux/files
I just tried moving ~/storage to ~/storagebak and rerunning termux-setup-storage, and it worked. I'll merge the folders.
@mbrick02, I think you were right, if run without a working SD card, you might need to remove ~/storage and run termux-setup-storage again.
@Quasic Thanks, so much, that worked!
Glad to share the solution! I just found out it sends a message to logcat. Maybe it should print it to the user, which is currently disabled, probably because am prints out stuff...
I/ViewRootImpl(15272): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl(15272): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl(15272): ViewRoot's Touch Event : ACTION_UP
I/ViewRootImpl(15272): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl(15272): ViewRoot's Touch Event : ACTION_UP
D/AndroidRuntime(15577): >>>>>> START com.android.internal.os.RuntimeInit uid 10115 <<<<<<
D/AndroidRuntime(15577): CheckJNI is OFF
D/AndroidRuntime(15577): Calling main entry com.android.commands.am.Am
D/AndroidRuntime(15577): Shutting down VM
E/termux-storage(15272): Could not delete old $HOME/storage
I/ViewRootImpl(15272): ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl(15272): ViewRoot's Touch Event : ACTION_UP
@Quasic Thanks again. I haven't tried using logcat in Android but it looks like a good addition to my tool bag as I move into the Android world.