[Q] NFS mountpoints and root/superuser privileges
Hi, I would like to know why I can see but not read files in NFS mounts unless they are in the primary storage location(internal storage - /data/media/0) and viewed from an app not running elevated privileges. (problem is if you have the mountpoint at a location you can only access with a file explorer running as root, you can see the files but not read them, and if you aren't root of course you can't get to the mountpoint). You can only read the files when running as a regular user which seems counter-intuitive to my understanding of the basic linux principal of root. This has only started recently, I am guessing android 4.2+
I am able to mount and read off NFS shares with stock kernel on CM10.2 (GS3), but it is a hassle because I have to switch my file explorers from root access to nonroot all the time.
the relevant line for my mounted share example from /etc/exports from server at local ip address 192.168.1.117:
I use smanage app (script manager) (and for some reason script must be run off of /storage/sdcard1 -- external sdcard, not internal memory) and flag it as "su"(root) and "boot"(makes it run at boot).
I have it set up so that I create the folders at boot, then either mount or unmount the network share with 3 different scripts that I can create widgets for on my home screen, but basic language should be same (note change "myth/myth1" to whatever folder names you have, and you only need the primary folder not a secondary, i just set it up this way because I have multiple mounts)
directory creation language:
busybox mount -t nfs 192.168.1.117:/home/myth/myth1 /data/media/0/myth/myth1 -o nolock,rsize=8192,wsize=8192
language to unmount:
Now some important things:
1- This server setup (etc/exports) worked fine and had no issues before android 4.2
2- I have had severe issues trying to mount at other points other than /data/media/0, so I can not recommend mounting anywhere else, though it may be possible
3- Starting with Android 4.2, there are major issues seeing things such as NFS mounts among different applications. For some reason I can see, but NOT READ files on the NFS share when the file explore app is running as ROOT/SU. This is why I have only recently been able to get it to work at /data/media/0, and that is because I figured out that the mountpoint has to be accessible by an app when it is not running root privileges. People have hinted that this has something to do with the new multiuser namespaces : see the bottom of this page: http://source.android.com/devices/te...age/index.html
any thoughts or understandings would be greatly appreciated on this so I can keep my NFS shares working with further changes