How to make gocryptfs mount from Termux root shell available to other apps?
1
vote
0
answers
128
views
I have a similar goal as discussed here 5,5 years ago:
But I'd prefer to use a file-based approach on-top of a "removable storage" setup managed by Android, so I can dynamically choose how much of it I want to use to store my private encrypted files only readable by this phone and other devices where I enter the key - and how much for unencrypted files I can share with other people by removing the microSD-card from my phone.
I managed to easily setup a gocryptfs volume using the DroidFS app installed via F-Droid and also mount it via a Termux root shell with
gocryptfs /storage/67DF-FCFD/DroidFS /mnt/crypt -nosyslog -allow_other
The remaining obstacle is how to make that decrypted view = mount of my gocryptfs volume available for any app to read from and write to?
I thought I could use a bind mount, see also: and
But so far everything I tried failed:
# mount | grep /crypt
/storage/67DF-FCFD/DroidFS on /mnt/crypt type fuse.gocryptfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=1048576)
tmpfs on /mnt/crypt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=3900340k,nr_inodes=975085,mode=755,gid=1000)
# ls -alih /mnt/crypt/1/
total 5.2M
1048987 -rwxrwx---. 1 root media_rw 773K Mar 11 22:06 IMG_20250311_220628_348196.jpg
1048988 -rwxrwx---. 1 root media_rw 2.1M Mar 11 22:06 IMG_20250311_220639_873732.jpg
1048989 -rwxrwx---. 1 root media_rw 2.1M Mar 11 22:06 IMG_20250311_220644_933558.jpg
# nsenter -m -t pgrep rs.media.module
-- mount -o bind /mnt/crypt/1 /storage/emulated/0/crypt
CANNOT LINK EXECUTABLE "mount": library "/data/data/com.termux/files/usr/lib/libtermux-exec.so" not found: needed by main executable
$ su -Mc mount -o bind /mnt/crypt/1 /storage/emulated/0/crypt
mount: '/mnt/crypt/1'->'/storage/emulated/0/crypt': No such file or directory
Please help! Thank you :)
Asked by xogoxec344
(11 rep)
Mar 12, 2025, 10:04 AM
Last activity: Mar 12, 2025, 10:06 AM
Last activity: Mar 12, 2025, 10:06 AM