termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
751 stars 161 forks source link

-b option enable for access mounted ext4? #136

Closed gyurmogyuri closed 3 years ago

gyurmogyuri commented 3 years ago

Hello I would like to know how to access a library? I know -b does that. But on proot command, I don't get what I want. Can anyone help?

$  proot-distro login ubuntu-20.04
root@localhost:~# echo "$SHELL"
/bin/bash
$ proot -R /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu-20.04 -0 -w / -b /dev -b /proc -b /sys  -b /mnt/media_rw/sdcard1 /bin/bash --login
bash: groups: command not found
root@localhost:/# echo "$SHELL"
/data/data/com.termux/files/usr/bin/bash

Why? Do you have idea?

ghost commented 3 years ago

proot-distro binds all possible android partitions and termux files unless isolated is specified

and yeah it would be nice to add bind mount configuration feature like the feature in chrome os named "Share with Linux"

gyurmogyuri commented 3 years ago

ok, but how can I access for my mounted ext4 partition in /mnt/media_rw/sdcard1 ?

ghost commented 3 years ago

You can't just bind mount ext4 external drives in proot nor in Termux without Android Permission,

But if Termux accesses your ext4 partition, then you have to wait until proot-distro user specific bind mount configuration is implemented

Alternative is to edit the proot-distro script and add Android's /mnt Bind Mount

RalfWerner commented 3 years ago

ok, but how can I access for my mounted ext4 partition in /mnt/media_rw/sdcard1 ?

@gyurmogyuri with df|grep rw you find /storage/* and with proot -p /storage ... you've access like in termux

gyurmogyuri commented 3 years ago

@gyurmogyuri with df|grep rw you find /storage/* and with proot -p /storage ... you've access like in termux @RalfWerner I cannot use /storage I have different file system as root and as user.

Alternative is to edit the proot-distro script and add Android's /mnt Bind Mount @WMCB-Tech Thanks for you. I did it:

$ nano /data/data/com.termux/files/usr/bin/proot-distro
line 780:           set -- "--bind=/storage" "$@"
line 781 add:           set -- "--bind=/mnt" "$@"

Thanks, solved

RalfWerner commented 3 years ago

I cannot use /storage I have different file system as root and as user.

You seem to have a rooted device where the sdcard1 is not linked in /storage (see df|grep rw). I've been using different ubuntu/debian Arch-versions on non-rooted devices with proot for two years and hadn't noticed any differences to termux. Nice, when you're glad with your solution!

I try to avoid proot if possible, because compared to direct termux a loss factor of 0.3-6 occurs.