Last active
December 3, 2023 10:08
-
-
Save aldur/4a3f90a111b71662f056 to your computer and use it in GitHub Desktop.
Mount an NFS share on Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Mount an NFS share on Android | |
# Requirements: | |
# - Busybox | |
# - A kernel supporting nfs (either built-in or as a module) | |
# On my Nexus 7 2012 I use the following kernel: | |
# http://forum.xda-developers.com/showthread.php?t=2107224 | |
# Remember: if you have problems of system space, simply delete some of the default stuff. | |
LOCAL_DIRECTORY="/data/media/0/2TB" | |
REMOTE_URI="192.168.1.101:/srv/nfs/2TB" | |
# Yes, we need to set permissive SeLinux in order for this to work | |
# At least on Android 5.0, obviously | |
setenforce Permissive | |
# Create the mount directory, if needed | |
mkdir -p $LOCAL_DIRECTORY | |
# And actually mount what you need | |
# You can't mount to /sdcard/ but you CAN mount to /data/media/0 | |
# Better mount ro, BTW | |
busybox mount -t nfs -o nolock,ro $REMOTE_URI $LOCAL_DIRECTORY |
Sorry for the bothering, I spent entire morning to get it working but no luck at all.
@JohnDoe44526949 hi man, i got same problem as yours, have your find the solution?
Nope, sorry.
hi, john, i got it
- flash supersu to your device
- then use
su -mm -c "mount command "
execute mount command, your app would access it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I mounted a nfs share, but files are only visible with root account. I can't change owner, and android file explorer don't see anything in shared folder.
How do I assign proper permissions to the shared folder so my apps can access it?
Thank you.