Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

SD Card , USB Storage #272

Open
hdt25 opened this issue Feb 23, 2023 · 9 comments
Open

SD Card , USB Storage #272

hdt25 opened this issue Feb 23, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@hdt25
Copy link

hdt25 commented Feb 23, 2023

Related problem

How do I access my SD card or Usb Storage (OTG)
Inside this Linux (Ubuntu)
It shows internal storage as (SD)
But don't show SD card storage Or Usb OTg

Describe the solution you'd like

It will be handy to have OTG access to Linux

Describe alternatives you've considered

No response

Additional context and details

No response

@hdt25 hdt25 added the enhancement New feature or request label Feb 23, 2023
@hdt25
Copy link
Author

hdt25 commented Feb 24, 2023

How could I mount that Usb Storage inside Linux Screenshot_20230224-101737_ZArchiver.png

@2moe
Copy link
Owner

2moe commented Feb 24, 2023

The most important point of this issue is: are you rooted?
By that I mean, do you have the root privilege for Android?

If you have root, you should be able to mount and access usb storage directly.
Otherwise, you will have to call the api manually.

Next, it will be assumed that you don't have root.

As far as I know, /mnt/media_rw/[device_id] is accessed via the Android Storage Access Framework.
I'm sorry I can't be of much help to you.
Here are some external links that may be of help to you.
termux-usb(wiki)
termux-packages-issues(otg)
termux-app-issues(usb otg)


As the proverb goes, all roads lead to Rome (i.e. Use different means to obtain the same result).
Since direct access is a bit of a pain, try indirect access!

Since your purpose is to access usb storage, you can share them with the network in the file manager.
Some file managers can share folders with ftp, others can use webdav.

@hdt25
Copy link
Author

hdt25 commented Feb 24, 2023

Certainly USB is not possible without root access. But can it access SD card as shared directory? I had seen mount 'sdcard' as Shared directory in while installation. Iam not sure about it .

What is the 'TF' in Tmoe settings?

I have installed jellyfin Server in Ubuntu container . So as media source, internal storage is not enough, so I want to access either SD card or Usb Storage.

If SD card is allowed as shared directory (SD) Then it is worth for me .

@2moe
Copy link
Owner

2moe commented Feb 24, 2023

TF is the MicroSD Card.
Although rare nowadays, some mobile devices do have a TF card slot.
When the card is inserted, it is mounted to /storage/XXXX-YYYY
ps: XXXX-YYYY (e.g. 4016-19FB) is the id of the card.


# df -h | grep 4016

/dev/fuse                            119G 102G   17G  86% /mnt/installer/0/4016-19FB
/dev/block/vold/public:179,1         119G 102G   17G  86% /mnt/media_rw/4016-19FB
/mnt/media_rw/4016-19FB              119G 102G   17G  86% /mnt/runtime/default/4016-19FB

# ls /storage

4016-19FB  emulated  self

You can then access the app directory: /storage/4016-19FB/Android/data/com.termux

Termux generates ~/storage/external-1 symlink when you use termux-setup-storage to get storage access.
And tmoe uses this symlink to get the path of the tf.

If you have a TF card and your device has a card slot, then you can mount the symlink to /media/tf inside the container

@2moe
Copy link
Owner

2moe commented Feb 24, 2023

If you see mount sdcard in tmoe, then it refers to /sdcard, /storage/emulated/0 or /storage/self/primary
If you see mount tf, it is an external MicroSD, not an internal sd.

@hdt25
Copy link
Author

hdt25 commented Feb 24, 2023

Thanks to clear my doubts. I thought sdcard is microsdcard .
But actually TF is what I was looking for.
I haven't inserted a microsdcard, so whenever I clicked TF , it would say permission denied.

So actually I have to insert a microsdcard.
Thanks 🙏

@GJVBCHJV
Copy link

Wow

@2moe
Copy link
Owner

2moe commented Feb 26, 2023

If you want to mount the entire tf directory, then you can do so.

mount_sd
mount sd: true
change the src dir -> yes
src_dir
source dir: /storage/XXXX-YYYY
Note: This is read-only.

change the mount point -> no

@hdt25
Copy link
Author

hdt25 commented Feb 26, 2023

Did this , and works . That's why I deleted the comment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants