T
Termux2d ago

Duplicated USB Drives in chroot

I'm very new to Termux and Linux overall. Im trying to access my external HDD via USB OTG. So what i did was i added
mount --bind /mnt/media_rw $mnt/media/usb
mount --bind /mnt/media_rw $mnt/media/usb
to the start script. Then i created a group with
groupadd -g 1077 external_storage
groupadd -g 1077 external_storage
then add my user
usermod -aG external_storage user
usermod -aG external_storage user
after doing that the USB UUID folder showed up with a red cross and i cant access it but, when i unplug and plug the otg while in DE, it still showed up with a red cross on the folder but this time i can read it, still no write permission (image 1). So i went back to the script i added the UUID folder this time.
mount --bind /mnt/media_rw/0242-16A8 $mnt/media/usb
mount --bind /mnt/media_rw/0242-16A8 $mnt/media/usb
. It worked now. I can access it with read and write permission but, there's 6 drives showed up instead of one (image 2). Is there a better way to do this? like, make it recognizes when a usb storage is plugged real time like how a normal android and desktop does. If not, how can i fix this 6 drives thing and make it shows only one. My device is Poco F1 running crDroid 11.7, Android 15. Rooted with KernelSU Next. If that helps.
No description
No description
Solution:
so I managed to fix the duplicate drives thing by creating symlink with
ln -s /mnt/media_rw/0242-16A8
ln -s /mnt/media_rw/0242-16A8
then mount that instead with
mount --bind /data/data/com.termux/files/home/0242-16A8/ $mnt/media/usb
mount --bind /data/data/com.termux/files/home/0242-16A8/ $mnt/media/usb
Jump to solution
1 Reply
Solution
행
2d ago
so I managed to fix the duplicate drives thing by creating symlink with
ln -s /mnt/media_rw/0242-16A8
ln -s /mnt/media_rw/0242-16A8
then mount that instead with
mount --bind /data/data/com.termux/files/home/0242-16A8/ $mnt/media/usb
mount --bind /data/data/com.termux/files/home/0242-16A8/ $mnt/media/usb

Did you find this page helpful?