0

Following this answer, I formated my sdcard as ext4-fs.

Then tried mounting the sdcard into termux home as the link above says

mount /dev/block/mmcblk1p2 /data/data/com.termux/files/home/ext4-fs

I get error mount: bad /etc/fstab: No such file or directory

I could only mount the partition with root using su command, only then the mount command doesn't give error.

Mounting the partition with su from terminal or with app like Link2Sd (which also uses root) makes the mount point (i.e where the partition is mounted) unreadable for Termux.

What am I missing?

He (the author of the answer above) even went further to create a symlink to Termux $PREFIX using another terminal app which is impossible without root also as thus also not readable by Termux which even complicates everything

I think this should be possible, what am I doing wrong pls

2
  • 2
    That's expected. mount never works without root (or at least CAP_SYS_ADMIN to be more precise). Mounting a filesystem is a privileged action not meant to be performed by ordinary users. // You need to set proper permissions; owner, group, mode and SELinux context on the mount point to make it accessible to non-privileged apps like Termux. Run ls -lZ . in Termux HOME directory to get these parameters. Commented Apr 8, 2021 at 17:37
  • Hi @Irfan thanks for looking to my question. Changing the owner, group to uid of Termux (gotten from id command) and also chmod 777 doesn't help. I get Permission denied. What's that with SELinux context, please any help will be appreciated
    – Mab
    Commented Apr 8, 2021 at 18:14

1 Answer 1

0

I had the same problem. The problem was SELinux. I resolved by installing "The SELinux Switch" and then putting in the "permissive" mode. Now I can mount with root and access in Termux WITHOUT root!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .