Hi guys,
Do any of you have successful solution to mount cifs shares with ANY kernel available? I've tried to do it with Project Flaming Monkey kernel, but had no luck. Most of the time I got "device not authorized" error when tried to mount via adb shell. But even if I could overcome this error (didn't figure out exact sequence of steps) it always says that mounting failed or even gets segfault.
With KTmanta kernel device is always authorized, I get root credentials immediately, but mounting also fails. Later I discovered that mounting actually happens and I can see it via adb shell, but it's invisible for all other users including root. Does it mean that 'mount using adb shell' trick doesn't work anymore?
Anyway I'll be very grateful for any kind of working solution or direction where to get it. Thanks in advance.
P.S. interesting but StickMount just works even on stock kernel that is said to have module loading disabled.
Sent from my Nexus 10 using xda app-developers app
uentity said:
Hi guys,
Do any of you have successful solution to mount cifs shares with ANY kernel available? I've tried to do it with Project Flaming Monkey kernel, but had no luck. Most of the time I got "device not authorized" error when tried to mount via adb shell. But even if I could overcome this error (didn't figure out exact sequence of steps) it always says that mounting failed or even gets segfault.
With KTmanta kernel device is always authorized, I get root credentials immediately, but mounting also fails. Later I discovered that mounting actually happens and I can see it via adb shell, but it's invisible for all other users including root. Does it mean that 'mount using adb shell' trick doesn't work anymore?
Anyway I'll be very grateful for any kind of working solution or direction where to get it. Thanks in advance.
P.S. interesting but StickMount just works even on stock kernel that is said to have module loading disabled.
Sent from my Nexus 10 using xda app-developers app
Click to expand...
Click to collapse
CM 10.2 plus Trinity Kernel plus Mount Manager works
I didn't yet tried trinity kernel
Thanks for the reply!
I think that kernel actually affects mounting process and not the ROM. Didn't tried trinity kernel yet, because author said that it's not feature complete for 4.3.
Do you have any issues with it? Everything works fine?
Sent from my Nexus 10 using xda app-developers app
uentity said:
I didn't yet tried trinity kernel
Thanks for the reply!
I think that kernel actually affects mounting process and not the ROM. Didn't tried trinity kernel yet, because author said that it's not feature complete for 4.3.
Do you have any issues with it? Everything works fine?
Sent from my Nexus 10 using xda app-developers app
Click to expand...
Click to collapse
Running the kernel version TX10, I have had some rare forced close issues, but i have no idea if it is kernel- or rom-related, propably the latter. Other than that it works just as well as any 4.2 combo I had before. Some kinks here and there, but perfectly usable.
I use Trinity with any 4.3 ROM and a script to mount my home file share. Works great.
I'm running 4.3 and Trinity kernel (tx17), I'm able to mount the cifs share from adb shell, I see the data there, but it's not available for the apps on the tablet. I also tried mounting the share using mount manager but it didn't help. I see it as a mounted, but no apps can see the data.
Where (mountpoint) and how should you mount the cifs share so it's visible for the rest of apps as well? Thx.
slano said:
I'm running 4.3 and Trinity kernel (tx17), I'm able to mount the cifs share from adb shell, I see the data there, but it's not available for the apps on the tablet. I also tried mounting the share using mount manager but it didn't help. I see it as a mounted, but no apps can see the data.
Where (mountpoint) and how should you mount the cifs share so it's visible for the rest of apps as well? Thx.
Click to expand...
Click to collapse
I remember having this problem, but I don't remember how I fixed it. Here's my script, compare it to yours to see if there's any difference. The below is all one line;
busybox mount -t cifs -o username=tv,password=<your_password>,rw,file_mode=0777,dir_mode=0777,uid=1000,gid=1000,unc=\\\\192.168.1.101\\files //192.168.1.101/files /data/media/0/TV-PC
I seem to remember it having something to do with mounting to /data/media/(whatever) or the uid/gid.
sttovo said:
I remember having this problem, but I don't remember how I fixed it. Here's my script, compare it to yours to see if there's any difference. The below is all one line;
busybox mount -t cifs -o username=tv,password=<your_password>,rw,file_mode=0777,dir_mode=0777,uid=1000,gid=1000,unc=\\\\192.168.1.101\\files //192.168.1.101/files /data/media/0/TV-PC
I seem to remember it having something to do with mounting to /data/media/(whatever) or the uid/gid.
Click to expand...
Click to collapse
Did try all possible combinations but still no luck. I've changed rom to Flaming Monkey and everything works like a charm there, so I'll probably stick with it for a while.
slano said:
Did try all possible combinations but still no luck. I've changed rom to Flaming Monkey and everything works like a charm there, so I'll probably stick with it for a while.
Click to expand...
Click to collapse
So to confirm, you did get cifs working with project flaming monkey rom or that's just the Rom you settled with since cifs never worked anyway? Did you use trinity kernel tx17? That's currently the combo I have and for the life of me cannot get it to work..... I am just learning about this so I'm sure it's me but if I know I have the same combo as someone who got it working, I will keep trying.
c683 said:
So to confirm, you did get cifs working with project flaming monkey rom or that's just the Rom you settled with since cifs never worked anyway? Did you use trinity kernel tx17? That's currently the combo I have and for the life of me cannot get it to work..... I am just learning about this so I'm sure it's me but if I know I have the same combo as someone who got it working, I will keep trying.
Click to expand...
Click to collapse
I've tried stock ROM with the Trinity kernel but no luck. I was able to mount the cifs filesystem, but it was not accessible for other apps. I've switched to Flaming monkey and everything mounted and was available just fine.
What is your problem with the current set-up? Will the share mount ok but it's not accessible from other apps or are you not able to perform the mount at all?
slano said:
I've tried stock ROM with the Trinity kernel but no luck. I was able to mount the cifs filesystem, but it was not accessible for other apps. I've switched to Flaming monkey and everything mounted and was available just fine.
What is your problem with the current set-up? Will the share mount ok but it's not accessible from other apps or are you not able to perform the mount at all?
Click to expand...
Click to collapse
Thanks for the reply. I have tried to use 3 different ways, below is a brief summary:
- CIFS Manager - No matter what I do, I get an "Invalid Argument" or "directory cant be found" error. Read and tried what is listed in CIFS FAQ to no avail.
- Mount Manger - Shows as connected, but there are no files; not in any apps or in the directory when using a file browser (root explorer or ES)
- Script - Yeah, just copied the script a few posts back and modified based on what I thought I needed to and used terminal emulator, gave it a go but nothing happens. Really don't know what I am doing with regard to script, over my head...
I also read that modules are needed but I thought the the trinity kernel already had them...
I am running the latest flaming monkey rom and trinity kernel on my nexus 10. So in short I really don't know exactly what I am doing but I will keep trying since I know you got it working with the same ROM and kernel setup. I can also access the files on my shared files through ES file explorer when I use the LAN or server feature so I know the PC is at least setup correctly, I think...
I haven't tried it on 4.3 yet. But the "Invalid argument" error is a problem in Linux kernels 3.4 in general. Take a look here:
How to Troubleshoot CIFS Problems on Android and Linux in General
I encountered that problem ever since JB. The problem is that mount is usually used in this way:
Code:
mount -o username=youruser,password=yourpasswd -t cifs //ipofpc/shareonpc dironphone
But that does not work in kernel 3.4. The share-directory as a device name is ignored. It has to be specified with argument unc. Like this:
Code:
mount -o unc=\\\\ipofpc\\shareonpc,username=youruser,password=yourpasswd -t cifs none dironphone
Note: since backslash is an escape character the double \\ is needed instead of \. It's also a good idea to specify noperm if you want the mounted directory to be accessible by all apps. Otherwise the mounted directory might only be accessible by root on the phone.
So a working example looks like this:
Code:
mount -o noperm,unc=\\\\10.0.0.200\\Public,username=guest,password=secret -t cifs none /sdcard/shares/nas
You have to work around that problem in CifsManager. Enter it like this:
Share Path: Enter anything. It will be ignored.
Mount Point: directory on phone: e.g. /sdcard/shares/nas
Username: enter user name
Password: leave empty
Options: e.g. noperm,unc=\\\\10.0.0.200\\Public,password=secret
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
gwodus said:
I haven't tried it on 4.3 yet. But the "Invalid argument" error is a problem in Linux kernels 3.4 in general. Take a look here:
How to Troubleshoot CIFS Problems on Android and Linux in General
I encountered that problem ever since JB. The problem is that mount is usually used in this way:
Code:
mount -o username=youruser,password=yourpasswd -t cifs //ipofpc/shareonpc dironphone
But that does not work in kernel 3.4. The share-directory as a device name is ignored. It has to be specified with argument unc. Like this:
Code:
mount -o unc=\\\\ipofpc\\shareonpc,username=youruser,password=yourpasswd -t cifs none dironphone
Note: since backslash is an escape character the double \\ is needed instead of \. It's also a good idea to specify noperm if you want the mounted directory to be accessible by all apps. Otherwise the mounted directory might only be accessible by root on the phone.
So a working example looks like this:
Code:
mount -o noperm,unc=\\\\10.0.0.200\\Public,username=guest,password=secret -t cifs none /sdcard/shares/nas
You have to work around that problem in CifsManager. Enter it like this:
Share Path: Enter anything. It will be ignored.
Mount Point: directory on phone: e.g. /sdcard/shares/nas
Username: enter user name
Password: leave empty
Options: e.g. noperm,unc=\\\\10.0.0.200\\Public,password=secret
Click to expand...
Click to collapse
Thank you for the detailed response, I will give that a try.
Sent from my Nexus 10 using xda app-developers app
c683 said:
Thank you for the detailed response, I will give that a try.
Sent from my Nexus 10 using xda app-developers app
Click to expand...
Click to collapse
BTW. I forgot. Before you try anything. Check if the directory /proc/fs/cifs exists. If it doesn't, then you are missing the required cifs kernel module. But more often then not, the kernel module is there and the problem is elsewhere.
gwodus said:
BTW. I forgot. Before you try anything. Check if the directory /proc/fs/cifs exists. If it doesn't, then you are missing the required cifs kernel module. But more often then not, the kernel module is there and the problem is elsewhere.
Click to expand...
Click to collapse
Thank you for your help. I thought for sure I tried what you said in your last post before as I read something similar. However, the info was wrong or I screwed up because when I followed your detailed description, it worked! The weird thing is some files open and others I'll get "the file doesn't exist error" but I am not concerned with it since I can get what I need. Thanks again.
c683 said:
Thank you for your help. I thought for sure I tried what you said in your last post before as I read something similar. However, the info was wrong or I screwed up because when I followed your detailed description, it worked! The weird thing is some files open and others I'll get "the file doesn't exist error" but I am not concerned with it since I can get what I need. Thanks again.
Click to expand...
Click to collapse
Awesome. You got it working!
I never ran across the "file doesn't exist" error. But I read around here that other people have such troubles too. It's probably a permission problem. Maybe try to play around with options like gid, forceuid, file_mode and dir_mode. A complete list of options is here: mount.cifs man page
gwodus said:
I haven't tried it on 4.3 yet. But the "Invalid argument" error is a problem in Linux kernels 3.4 in general. Take a look here:
How to Troubleshoot CIFS Problems on Android and Linux in General
I encountered that problem ever since JB. The problem is that mount is usually used in this way:
Code:
mount -o username=youruser,password=yourpasswd -t cifs //ipofpc/shareonpc dironphone
But that does not work in kernel 3.4. The share-directory as a device name is ignored. It has to be specified with argument unc. Like this:
Code:
mount -o unc=\\\\ipofpc\\shareonpc,username=youruser,password=yourpasswd -t cifs none dironphone
Note: since backslash is an escape character the double \\ is needed instead of \. It's also a good idea to specify noperm if you want the mounted directory to be accessible by all apps. Otherwise the mounted directory might only be accessible by root on the phone.
So a working example looks like this:
Code:
mount -o noperm,unc=\\\\10.0.0.200\\Public,username=guest,password=secret -t cifs none /sdcard/shares/nas
You have to work around that problem in CifsManager. Enter it like this:
Share Path: Enter anything. It will be ignored.
Mount Point: directory on phone: e.g. /sdcard/shares/nas
Username: enter user name
Password: leave empty
Options: e.g. noperm,unc=\\\\10.0.0.200\\Public,password=secret
Click to expand...
Click to collapse
I tried your solution (4.4, Nexus 5) and it actually mounts the volume correctly. The only problem is that mounted content is visibile only if you're root: i can't see the folders mounted from the applications even if the cifsmanager say it has been mounted.
I verified by mounting the volume via ADB and navigated to the mounted folder -> root can see the folder and normal user can't.
I also tried adding the parameters "rw,file_mode=0777,dir_mode=0777,nounix,iocharset=utf8", nothing.
Do you know something about this?
Same problem here on 4.4 N4
Sent from my Nexus 4 using Tapatalk 2
root only problem
ludalex07 said:
I tried your solution (4.4, Nexus 5) and it actually mounts the volume correctly. The only problem is that mounted content is visibile only if you're root: i can't see the folders mounted from the applications even if the cifsmanager say it has been mounted.
Click to expand...
Click to collapse
i've got the same issue on nexus 7 (new) running 4.3
here is my mount command:
mount -o noperm,unc=\\\\192.168.2.16\\Volume_2,username=guest,password=guest -t cifs musiq /sdcard/NAS
root only can see it.
from google groups, someone seems to have a workaraound, but i can not firgure out excactly what he means:
"when I mount using a shell-script (masked as a system-service like /system/bin/debuggerd) with "/system/bin/start" the mount is visible systemwide"
i tried replacing debuggerd with a script, but it is not part of the start-up services, so i am guessing /system/bin/start has to be invoked somehow?
noktilux said:
i've got the same issue on nexus 7 (new) running 4.3
here is my mount command:
mount -o noperm,unc=\\\\192.168.2.16\\Volume_2,username=guest,password=guest -t cifs musiq /sdcard/NAS
root only can see it.
from google groups, someone seems to have a workaraound, but i can not firgure out excactly what he means:
"when I mount using a shell-script (masked as a system-service like /system/bin/debuggerd) with "/system/bin/start" the mount is visible systemwide"
i tried replacing debuggerd with a script, but it is not part of the start-up services, so i am guessing /system/bin/start has to be invoked somehow?
Click to expand...
Click to collapse
The debugger method is described here: http://forum.xda-developers.com/showpost.php?p=37751808&postcount=55
Not sure it will work on 4.3, but you can give it a try.
Related
*** I am not responsible for any damage, lost or explosion. So, try it as your own risk ***
I successfully mount my 250G powered external HD with NTFS partition on this post: http://forum.xda-developers.com/showpost.php?p=14650094&postcount=146
Here are the steps:
1. Root is a must
2. Install any terminal emulator from the market.
3. d/l and extract the ntfs.ko to your i9100
4. load the ntfs.ko with insmod (update: Some custom kernel doesn't work with module, try CF-root kernel or any stock kernel if you have problem loading the module)
5. Connect your drive with OTG.
6. Don't need to worry about "USB storage blank or has unsupported file" complaint in the notification area. But you may need a Y splitter USB cable with power supply if you got an high power consumption complaint.
7. Follow the screen shoot for the mounting command. "iocharset=utf8" is needed if you have non English files/folders name
8. Verify the mount with ls command
9. Verify non root apps (e.g. Astro File Manager) are able to read the files
10. After you done, make sure no process is accessing the mount, then un-mount using the umount command. You may want to remove the module using rmmod.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
[request] Can this be done with a sdcard? That would be nice.
Maybe built in a rom
Awesome work il give it a try.. Just one question lol whats insmod?
Sent from my GT-I9100 using XDA App
I have a problem with "mount" - "mount: can't read /etc/fstab: No such file or directory". What's wrong? I can't find fstab in /etc, there is only vold.fstab.
Try
#cat /proc/mounts > /etc/fstab
#chmod 644 /etc/fstab
Now I have /etc/fstab but "mount: can't find /dev/block/sd in /etc/fstab".
How can I build a good fstab???
Edit: nevermind, I used a bad command, it works now but read only, so I'm waiting for a full working module. Thanks very much for your works jackleung. Best regards!
jackleung said:
*** I am not responsible for any damage, lost or explosion. So, try it as your own risk ***
I successfully mount my 250G powered external HD with NTFS partition on this post: http://forum.xda-developers.com/showpost.php?p=14650094&postcount=146
Here are the steps:
1. Root is a must
2. Install any terminal emulator from the market.
3. d/l and extract the ntfs.ko to your i9100
4. load the ntfs.ko with insmod
5. Connect your drive with OTG.
6. Don't need to worry about "USB storage blank or has unsupported file" complaint in the notification area. But you may need a Y splitter USB cable with power supply if you got an high power consumption complaint.
7. Follow the screen shoot for the mounting command. "iocharset=utf8" is needed if you have non English files/folders name
8. Verify the mount with ls command
9. Verify non root apps (e.g. Astro File Manager) are able to read the files
10. After you done, make sure no process is accessing the mount, then un-mount using the umount command. You may want to remove the module using rmmod.
Click to expand...
Click to collapse
Can you please upload a video showing how to do it for noobs
Sent from my GT-I9100 using XDA App
Waiting for my OTG Cable to arrive and will 100% try this. Do you get a good playback speed of 720p/1080p videos using ntfs drives?
hakkinenvthh said:
Edit: nevermind, I used a bad command, it works now but read only, so I'm waiting for a full working module. Thanks very much for your works jackleung. Best regards!
Click to expand...
Click to collapse
What command have you use finally? I was thinking you may have different block device instead of hda1.
For writing, we may need NTFS-3G but that I don't know where to get the source for **Android**. And I really don't have time to dig into that yet.
mythoc said:
Waiting for my OTG Cable to arrive and will 100% try this. Do you get a good playback speed of 720p/1080p videos using ntfs drives?
Click to expand...
Click to collapse
I haven't try. Practically, media sharing over Samba (cifs) is more useful for me. I can watch 720p video over the wireless G network shared folders.
@Tulips, it should work but may not be useful without write ability.
insmod = insert modules
lsmod = list modules
rmmod = remove modules
okey, sdcard works using the device /dev/block/mmcblk1p1, but as you said read only.
@jackleung : Where did you get this module from? Did you build it yourself from the kernel source, or downloaded it from somewhere else? As far as I understood, the linux kernel now fully supports ntfs rw capabilities (for several years, if I'm not mistaken).
Tulips said:
@jackleung : Where did you get this module from? Did you build it yourself from the kernel source, or downloaded it from somewhere else? As far as I understood, the linux kernel now fully supports ntfs rw capabilities (for several years, if I'm not mistaken).
Click to expand...
Click to collapse
I built from the kernel source d/l from Samsung. Here is the situation stated in wiki:
The ability to read and write to NTFS is provided by the NTFS-3G driver. It is included in most Linux distributions. Other solutions exist as well:
Linux kernel 2.2: Kernel versions 2.2.0 and later include the ability to read NTFS partitions
....
Note that all three userspace drivers, namely NTFSMount, NTFS-3G and Captive NTFS, are built on the Filesystem in Userspace (FUSE), a Linux kernel module tasked with bridging userspace and kernel code to save and retrieve data.
Click to expand...
Click to collapse
I do find the FUSE in the kernel source, but I believe we still need some user space program like NTFS-3G to manage it.
jackleung said:
What command have you use finally? I was thinking you may have different block device instead of hda1.
For writing, we may need NTFS-3G but that I don't know where to get the source for **Android**. And I really don't have time to dig into that yet.
Click to expand...
Click to collapse
I used exactly the same to you I think it's better if you can make it mounted automatically (by modify the kernel???) or make a software to do it
I can mount a NTFS microsd but after that the phone can't be recognized by the PC, unless I format it by the phone
mythoc said:
Waiting for my OTG Cable to arrive and will 100% try this. Do you get a good playback speed of 720p/1080p videos using ntfs drives?
Click to expand...
Click to collapse
well i watched 1080p clips and they worked perfectly fine, the file size was 8gb, not sure about bitrate or anything though
why is this not in the Dev Section???!!
[email protected]!
My first successful attempt with ntfs-3g can be found here: http://forum.xda-developers.com/showpost.php?p=15001824&postcount=23
jastonas said:
why is this not in the Dev Section???!!
[email protected]!
Click to expand...
Click to collapse
Because nothing being developed. I simply compiled a module from existing source code.
I wrote two small shell scripts for mount and unmount.
Both i can run in GScript (free light version from market).
The first ist mounting:
Code:
insmod /mnt/sdcard/ntfs.ko
mkdir /mnt/sdcard/usbStorage/usb_ntfs
sleep 1
mount -t ntfs -o rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1015,fmask=0002,dmask=0002,iocharset=utf8 /dev/block/sda1 /mnt/sdcard/usbStorage/usb_ntfs
And this one for unmounting:
Code:
umount -f /mnt/sdcard/usbStorage/usb_ntfs
rmmod ntfs
Both scripts are attached and if they are saved on sdcard in a folder namend "gscript" they can be imported directly into GScript.
The ntfs.ko file has to be placed in the root folder of the SD-Card (/mnt/sdcard/ntfs.ko).
@jackleung: Thank you for compiling
Ps: sorry for my bad english... ;-)
Could someone please upload a video on youtube showing how to do it. I dont understand all this mount and unmount.. Do i need to unmount before i take out the usb drive?
Sent from my GT-I9100 using XDA App
Could you compile ext3 kernel module too, please ?
I'm trying to mount a linux image but there's no ext3 support so I cannot mount it
alx5962 said:
Could you compile ext3 kernel module too, please ?
I'm trying to mount a linux image but there's no ext3 support so I cannot mount it
Click to expand...
Click to collapse
Maybe ext2/3 doesn't even need a module? Could someone just try this command?
Code:
mount -t ext2 -o uid=1000,gid=1015,iocharset=utf8,umask=000 /dev/block/sda1
(.../dev/block/mmcblk1p1 for microSD)
Help wat do i do i keep getting this
Sent from my GT-I9100 using XDA App
Been trying to get this to work for hours, followed endless amounts of tutorials, I've hit a brick wall and am finally at the point I need to ask for more specific help.
I have 32gb Nexus 7 wifi only
Version: 4.2.1
Kernal: Motley's kernal 3.1.10-motley-v3+
Build Number:JOP40D
I started with CifsManager, couldn't get it to work because of no/wrong modules, tried many I found in tutorials around the net, eventually found I needed a new kernal, settled on Motley's, this finally allowed cifs to mount the folder, but the folder is always empty.
Came across Mount Manager, set it up, same problem.
Here's what my settings look like:
CifsManager:
Share Path: 192.168.1.18/y
Mount Point: /mnt/sdcard/cifs/pcY
Username: Comp1
Password: Password
Options: iocharset=utf8
I have tried it with options blank, same thing, yes my share is called y, Comp1 is the account I set up to access shares, no my password is not really password but you get the idea. I can access this share fine from other devices including my wii using the same settings.
Mount manager is basically the same except I made the mount point /compY because I didn't know if it would conflict, and it has file_mode and dir_mode = 0777.
Thank you for your time and any help is greatly appreciated.
Still searching for a solution, even a nudge in the right direction would help a lot right now.
I found out how chainfire solved this problem. (And did not said how ) I think my thread got lost ist the Android General section.... I should have posted it in the Nexus 7 General. (I tested it on my Nexus 7)
http://forum.xda-developers.com/showthread.php?t=2062768
vorcers said:
I found out how chainfire solved this problem. (And did not said how ) I think my thread got lost ist the Android General section.... I should have posted it in the Nexus 7 General. (I tested it on my Nexus 7)
http://forum.xda-developers.com/showthread.php?t=2062768
Click to expand...
Click to collapse
Thank you very much for your reply.
I am very new to this, I can't quite follow what I am supposed to do, I think start the file debuggerd as a system service? I can find the file, but I can't find out how to start it, I've done a few searches on this site and google but have come up empty, could you please explain exactly what I need to do to make this solution work?
Thanks again for your help
(For germans: "Bitte nagelt mich nicht darauf fest" (Auf die Informationen) Sorry, I don't know the english phrase for this...)
The "debuggerd" is an "debugger daemon". It can be started with "start debuggerd" and stopped with "stop debuggerd". I think errors at excecution are posted in dmesg or logcat.
The main thought behind this, that the debuggerd is started by "start" with higher privileges even then our normal su. (Or it does mount something, I don't know) So, if you backup the original /system/bin/debuggerd and write your own commands into that file and start it via "start debuggerd" these commands are executed with these "high privileges". For example, if you write these content in debuggerd and start it, the share should be available for all apps. (Well, only if "others" have r (? wx ?) permissions on server...)
/system/bin/debuggerd
Code:
#!/bin/sh
busybox mount -t cifs //server/share /mnt/sdcard/mnt -o username=max,password=mustermann)
You can also mount devices with this method...
Well, you can't use this with the manager, because the manager needs to be changed to support this.
I hope this helps you.
You can turn on your "ADB over network".Then you con connect from your device with
adb connect 127.0.0.1:5555
Click to expand...
Click to collapse
now youre ready to mount but the foders are visable only in the apps that are been started befour mount can see the folder.
Tornadough said:
Still searching for a solution, even a nudge in the right direction would help a lot right now.
Click to expand...
Click to collapse
Here's a solution that can be implemented by ROMs or kernels to fix app mount support in Android 4.2 without requiring modifications to CifsManager or other apps.
I'd recommend asking your favorite ROM to incorporate the dalvik/init.rc patches.
vorcers said:
The main thought behind this, that the debuggerd is started by "start" with higher privileges even then our normal su.
Click to expand...
Click to collapse
What's happening is that the debuggerd process is spawned directly by init, which uses the default mount namespace, so any mount operations are shared with/visible to all other processes.
The problem is that when an app calls "su" to mount a file system, it's already walled off in a separate mount namespace by virtue of the app itself having been spawned from zygote. Basically, any process whose ancestry can be traced back to zygote can't mount file systems visible to other apps. Those whose process ancestry don't include zygote can. Which is why manually mounting file systems from adb (with either "su" or "adb root") also works.
After all this time nobody has updated any app to fix this problem?
Hi folks
My issue that I cannot seem to resolve is one of CIFS share mounting. I have trawled the XDA forums, google, and many many other android sites with no luck.
Current state
Nexus 4
CyanogenMod 10.1 RC4 (but have been running nightlies and RCs almost since release)
Latest version of CifsManager
Folders created:
/mnt/cifs/*
Where * is various folder names matched to my CIFS shares being served from an OpenMediaVault storage PC.
My understanding is that CM10.1 has CIFS support built into the kernel, as there are no cifs modules in the usual places one would expect to find them.
No matter what I try in CifsManager, the mount fails with:
Code:
Mounting the share has failed with an error. mount: Invalid argument
I thought this may be an issue with CifsManager, so I hopped into the shell to see what I could find. I am no *nix guru, but am comfortable (mostly) in the commandline.
I fired up ADB, connected the device and entered an ADB shell with root access via su.
I issued a BUNCH of different mount commands, with no luck, some of which were:
Code:
mount -t cifs //192.168.1.3/share1 /mnt/cifs/share1
mount -o username=<username> -t cifs //192.168.1.3/share1 /mnt/cifs/share1
mount -o username=<username>,password=<password> -t cifs //192.168.1.3/share1 /mnt/cifs/share1
I tried variations of these with the options after the type and vice versa, and with one/both of those after the device/mount point pieces.
All consistently gave the same error as CifsManager:
Code:
mount: Invalid argument
I even tried using
Code:
-t smbfs
and get the following error:
Code:
mount: No such device
The only additional note I could find that I thought worth mentioning is this entry in dmesg:
Code:
<3>[14314.292444] CIFS VFS: Connecting to DFS root not implemented yet
At this point I am officially out of ideas and operating beyond my capabilities so if you have any suggestions or advice, please let me know what additional information I can provide here.
I should note that I have two Xoom's and an SGS2 all of which mount these shares fine. The Xooms are running EOS4 and the SGS2 was also running CM10.x - interestingly both of these ROMS had cifs modules rather than having them built into the kernel.
Thanks in advance.
/system/xbin/mount (soft-linked to busybox) rather than /system/bin/mount (linked to toolbox) works for me. I'm not sure that it's entirely safe to point the link in "bin" to busybox (which is necessary if you're using CifsManager as it has no option to set a path to "mount"), but everything seems to be alright, except that the busybox'es "mount" refuses to remount root read-write sometimes, and you need to specify a different dir for CifsManager (e.g. /data/cifs instead of /mnt/cifs).
[SOLVED]
OK,
so with a bit of luck, I seem to have got to the bottom of this.
Within CifsManager, the following configuration for a share works:
Share Path
<IP address>/<share>
Mount Point
/mnt/cifs/<share>
Username
<username>
Password
Leave blank - if this is populated, it causes the "Invalid argument" error when mounting the CIFS share.
Options
Code:
unc=\\\\<IP address>\\<share>,pass=<password>
Now that I have it working, I remember reading on a post long time ago, that if the CIFS module is built into the kernel it required the unc= option to work.
Would it be worth getting in touch with the CifsManager devs and logging this as a bug do you think?
[keywords]
How to mount a cifs share on Google Nexus 4 with CifsManager and CyanogenMod 10
Does it still works? I am using CM 10.1 nightly based on Android 4.2.2 and I am unable to make it work.
Do you use a kernel other than CM default?
Why do i want to mount cifs? Any specific reason?
Sent from my Nexus 4
kewlfais said:
Why do i want to mount cifs? Any specific reason?
Sent from my Nexus 4
Click to expand...
Click to collapse
I want to conect to my samba share over wifi. I'd prefer to mount them because, If I can mount them, I am free to use all programs/file explorers etc. to browse files/watch movies etc.
Well basically nexus talks only on mtp protocol.
U have options of connecting ur device via ssh by installing ssh server on phone but for me it wss slow so i dropped that.
Even there is a app name software data cable which connects via ftp.
Sent from my Nexus 4
---------- Post added at 02:08 AM ---------- Previous post was at 02:07 AM ----------
Or use airdroid that is also good app
Sent from my Nexus 4
gergefil said:
Does it still works? I am using CM 10.1 nightly based on Android 4.2.2 and I am unable to make it work.
Do you use a kernel other than CM default?
Click to expand...
Click to collapse
Hi
yes this still works. Please note my original post got screwed up by the forums - it removed some of the \'s. I have fixed this now in the original post, but by explanation there should be double the number of normal \'s in the UNC path (as escape characters I guess) so \ \ \ \ unc \ \ path
I do not use any custom kernel, just what is in the standard nightly CM builds (I also update to most nightlies..)
I hope this is clear
Swaziboy said:
Hi
yes this still works. Please note my original post got screwed up by the forums - it removed some of the \'s. I have fixed this now in the original post, but by explanation there should be double the number of normal \'s in the UNC path (as escape characters I guess) so \ \ \ \ unc \ \ path
I do not use any custom kernel, just what is in the standard nightly CM builds (I also update to most nightlies..)
I hope this is clear
Click to expand...
Click to collapse
I am now able to make it work. Thanks.
Hey Swaziboy,
I have one more question:
Did you try to mount cifs share anywhere other than /mnt/cifs/SHARE
I want all applications to see my share, so I try to mount them into /mnt/sdcard/SHARE When I mount it to /mnt/cifs/ everything is perfect. However when I try to mount it into /mnt/sdcard/SHARE, cifs manager says it is mounted, however I can't see it on mount list and, it is not mounted at all.
Do you have any idea/suggestions?
I've been reading as much as I can if it is possible to mount a network share with your Nexus 10. I've downloaded both cifsmanager and mount manager, and can get neither to work.
I can connect to my network with mount manager and some other apps. But getting the Nexus 10 to see your shares as a local folder seems to be a big PIA.
Does anyone have it working, and can they document the steps?
I'm also using CM 10.1, but will flash to any kernel if it can be done.
Thanks
PT
ptmuldoon said:
I've been reading as much as I can if it is possible to mount a network share with your Nexus 10. I've downloaded both cifsmanager and mount manager, and can get neither to work.
I can connect to my network with mount manager and some other apps. But getting the Nexus 10 to see your shares as a local folder seems to be a big PIA.
Does anyone have it working, and can they document the steps?
I'm also using CM 10.1, but will flash to any kernel if it can be done.
Thanks
PT
Click to expand...
Click to collapse
Here is a link that discusses CIFS.
http://goo.gl/ot1mi
Also search for CIFS in the developer's forum that discusses your ROM. The issues with CIFS surround the addition of multi-user support in 4.2.2. That feature meant the mount command needed additional arguments plus you need to create RSA keys. The link above provides that information and other details.
I have it working. Requires a specific set of kernel modules, which means a specific ROM/kernel combination.
I use mrRobinsons AOKP PUB ROM with KTmanta kernel.
After that, I run a script as root to mount the CIFS share, in my case:
Username is the source PC windows username, and then password
The 192.168.1.101\files is the path to my share, extra \ needed for *nix escaping
The /data/media/0/TV-PC is the path on my tablet, empty directory where the mount will occur.
#!/system/bin/sh
#This will mount cifs shares if the network is available
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
busybox mount -t cifs -o username=tv,password=<YOUR_PASSWORD>,rw,file_mode=0777,dir_mode=0777,uid=1000,gid=1000,unc=\\\\192.168.1.101\\files //192.168.1.101/files /data/media/0/TV-PC
sttovo said:
I have it working. Requires a specific set of kernel modules, which means a specific ROM/kernel combination.
I use mrRobinsons AOKP PUB ROM with KTmanta kernel.
After that, I run a script as root to mount the CIFS share, in my case:
Username is the source PC windows username, and then password
The 192.168.1.101\files is the path to my share, extra \ needed for *nix escaping
The /data/media/0/TV-PC is the path on my tablet, empty directory where the mount will occur.
#!/system/bin/sh
#This will mount cifs shares if the network is available
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
busybox mount -t cifs -o username=tv,password=<YOUR_PASSWORD>,rw,file_mode=0777,dir_mode=0777,uid=1000,gid=1000,unc=\\\\192.168.1.101\\files //192.168.1.101/files /data/media/0/TV-PC
Click to expand...
Click to collapse
Thanks Stove. I'm changing to mrRobinsons AOKP PUB ROM with KTmanta kernel.
But when it comes to running the script, do you need to have the app open first before mounting the share? Or will the native apps find everything with not issues?
Just an update that I SSH'd into my Nexus 10 and ran the script in a terminal.
I now see the shares mounted in a terminal. But I do not see anything mounted when in either ES File Explorer any other app.
ptmuldoon said:
Just an update that I SSH'd into my Nexus 10 and ran the script in a terminal.
I now see the shares mounted in a terminal. But I do not see anything mounted when in either ES File Explorer any other app.
Click to expand...
Click to collapse
I think I had this problem too, but I regret I don't remember how i fixed it. I *think* it had something to do with permissions. Did you use the uid and gid arguments that I had in my script? Also, my CIFS mount point is under my data /sdcard (data) mount, if you're mounting under / then that might change things.
I run my script directly from my Nexus 10 in a terminal as root.
May want to look in the thread linked below, this is where I got what I needed for the script.
Edit - check post 62 in this link. Looks like it's related to setting the ownership bits… 0777
http://forum.xda-developers.com/showthread.php?t=2003836
I use esfileexplorer to access my samba shares. It's not a permanent mount in the root fs, but i can watch videos thid way.
nvertigo67 said:
I use esfileexplorer to access my samba shares. It's not a permanent mount in the root fs, but i can watch videos thid way.
Click to expand...
Click to collapse
Yes, but that's not the same as mounting a shared network folder. The idea is for all native apps to see your media as if it was locally on your device
sttovo said:
I think I had this problem too, but I regret I don't remember how i fixed it. I *think* it had something to do with permissions. Did you use the uid and gid arguments that I had in my script? Also, my CIFS mount point is under my data /sdcard (data) mount, if you're mounting under / then that might change things.
I run my script directly from my Nexus 10 in a terminal as root.
May want to look in the thread linked below, this is where I got what I needed for the script.
Edit - check post 62 in this link. Looks like it's related to setting the ownership bits… 0777
http://forum.xda-developers.com/showthread.php?t=2003836
Click to expand...
Click to collapse
Sttove.. You may be on to something. .. The script/mount command already is suing 0777, but I noticed i could not create a folder in terminal after mounting the share.
I hope to do some more testing and research when I get back home tonight.
ptmuldoon said:
Yes, but that's not the same as mounting a shared network folder. The idea is for all native apps to see your media as if it was locally on your device
Sttove.. You may be on to something. .. The script/mount command already is suing 0777, but I noticed i could not create a folder in terminal after mounting the share.
I hope to do some more testing and research when I get back home tonight.
Click to expand...
Click to collapse
One other thing I just thought of, how is your share setup on the server side? If you go into Advanced Sharing for the share, then Permissions, make sure you have Everyone set to read, write, etc… That leaves your share wide open, but at least something you can test.
sttovo said:
One other thing I just thought of, how is your share setup on the server side? If you go into Advanced Sharing for the share, then Permissions, make sure you have Everyone set to read, write, etc… That leaves your share wide open, but at least something you can test.
Click to expand...
Click to collapse
I can SSH into the Nexus10 via a terminal/putty from a PC. Create the mount point, and then see my share info. I am then also able to create a directory in terminal as well.
But when I than go to the Nexus and ESFile Explorer or any other app, the mapped share folder is blank.
I think I read something on blank mount/shares, but will have to keep looking into it.
Has anyone seen that happen before and know its cause?
Hello there!
I'm not sure wether this is the right Forum thread, nor if it's even possible.
English is not my first language, but i hope i can make myself clear and explain my problem.
As in the title mentioned I just want to mount a nfs share into my filesystem so that i can access my media through a vpn whereever I go.
I'm using a Synology Diskstation as NAS and created some NFS-shares (tried version 3 and 4) which are accessable in my Network. It's working flawless with my raspberry pi and with my debian system. I don't want to use smb (cfis).
I want to use my favorit musicplayer to listen to my music, mounted via fstab in the musicfolder for example.
Right now i'm using the yatse app, works fine - but it's just a workaround....
I tried FreedomOS(stock kernel and elementalx)+busybox and Resurrection Remix(stockkernel and lightningkernel)+ busybox. All i get is Invalid argument or error messages. I just can't get it to work. It's a linux system, why can't i use a simple nfs share?
Any help would be apreciated.
Thanks in advance!
I used to mount a nfs share with busybox so be sure to have that installed.
next be sure to have a working VPN connection to your home network.
One more thing to check is that VPN connections are allowed to access the nfs shares. Dont know if you need to set this up with synology or that it's enabled by default.
Thanks for the response.
I have all permissions set to get access to the nfs-share, tried it without vpn aswell. The vpn itself is working like a charm.
I have access to my NAS via webinterface and sftp, i can control and stream from my raspberry pi aswell. No problems with the vpn for sure.
I'm using busybox aswell. Can you post me your mount command or your fstab line for the mount?
the1weasel said:
Thanks for the response.
I have all permissions set to get access to the nfs-share, tried it without vpn aswell. The vpn itself is working like a charm.
I have access to my NAS via webinterface and sftp, i can control and stream from my raspberry pi aswell. No problems with the vpn for sure.
I'm using busybox aswell. Can you post me your mount command or your fstab line for the mount?
Click to expand...
Click to collapse
I used this i believe.
Your kernel needs to support it.
https://gist.github.com/aldur/4a3f90a111b71662f056
maikvitesse said:
I used this i believe.
Your kernel needs to support it.
https://gist.github.com/aldur/4a3f90a111b71662f056
Click to expand...
Click to collapse
Thats exactly what i was told over here https://forum.xda-developers.com/oneplus-5/development/kernel-elementalx-op3-1-00-t3626808/post73156290#post73156290
I will follow up on that, thanks for pointing me in the right direction aswell.
Ok, i was able to mount the share.
Now that it's getting a general question i will follow up here. I posted what i did over here aswell and got it solved to this state.
I can see the files in the Terminal, but not in any App (explorer, musicplayer etc.).
As i already wrote here: https://forum.xda-developers.com/showpost.php?p=73161675&postcount=437 I'm guessing it's because i mounted as root so normal users can't use it. Or at least thats what I'm thinking.
I searched the forum already and just found a thread with someone having the same problem without solution.
Is there a way that i can use the mounted share with any app I want?
Just for the roundup.
Here is whats working:
mount a nfs-share through an terminal app. => Files are visible/browsable
whats not working:
Use the mounted nfs-share systemwide with any other app.
What i tried (used Termux):
mount into /mnt/remotenfs => files show up in terminal, just there.
mount into /storage/emulated/0/Music/remote => files show up in terminal, just there.
mounted the share and then started an explorer (solidexplorer) from terminal - same result. No fileaccess through explorer.
the1weasel said:
Just for the roundup.
Here is whats working:
mount a nfs-share through an terminal app. => Files are visible/browsable
whats not working:
Use the mounted nfs-share systemwide with any other app.
What i tried (used Termux):
mount into /mnt/remotenfs => files show up in terminal, just there.
mount into /storage/emulated/0/Music/remote => files show up in terminal, just there.
mounted the share and then started an explorer (solidexplorer) from terminal - same result. No fileaccess through explorer.
Click to expand...
Click to collapse
I think I suggested something like this as a way to glean some information about this problem in the other thread, but don't recall for certain what the outcome if any was:
At least since V5 and above of Android OS, there's been some sort of thread insularity that keeps another thread from seeing what some of the first one sees. (moreso than before V5). I figured that since fstab.qcom (or whatever the name of the actual startup file where "mount -a" is pointed) must contain the mounted partitions that are visible to all. If that's the case, it's either the startup mount daemon, or it is in one of the columns of each "mount" entry in fstab.*.
I think I suggested adding a mount entry without the "automount at start" parameter for your remote music. Just curious if that was tried? Also, I thought the file where these were entries were kept in M & N (6 & 7) had "*vold*" in the title.
I'm also curious about this and will look around for some better answer because it seems very non-linux / android that only the thread performing the action can see the result (although that is how local actions / variables act).
After some poking around: I think this link explains some possible reasons for this behavior, not that there isn't some way around it. Probably there is no way around it without some compromise of whatever privacy additions android OS is after. It sounds a lot like an SELinux & /proc FS change. https://stackoverflow.com/questions/38590140/file-system-changes-in-android-nougat
hachamacha said:
I think I suggested something like this as a way to glean some information about this problem in the other thread, but don't recall for certain what the outcome if any was:
At least since V5 and above of Android OS, there's been some sort of thread insularity that keeps another thread from seeing what some of the first one sees. (moreso than before V5). I figured that since fstab.qcom (or whatever the name of the actual startup file where "mount -a" is pointed) must contain the mounted partitions that are visible to all. If that's the case, it's either the startup mount daemon, or it is in one of the columns of each "mount" entry in fstab.*.
I think I suggested adding a mount entry without the "automount at start" parameter for your remote music. Just curious if that was tried? Also, I thought the file where these were entries were kept in M & N (6 & 7) had "*vold*" in the title.
I'm also curious about this and will look around for some better answer because it seems very non-linux / android that only the thread performing the action can see the result (although that is how local actions / variables act).
After some poking around: I think this link explains some possible reasons for this behavior, not that there isn't some way around it. Probably there is no way around it without some compromise of whatever privacy additions android OS is after. It sounds a lot like an SELinux & /proc FS change. https://stackoverflow.com/questions/38590140/file-system-changes-in-android-nougat
Click to expand...
Click to collapse
Thanks for the response, looks like you are much more into that android thing....
I just added
"10.11.12.10:/volume1/Audio /storage/emulated/0/Music/remote nfs nolock,ro defaults"
to the fstab.qcom . Doesn't mount at startup.
I realized some inconsitency in the ssh thing, sometimes it works mounting via ssh, sometimes not....strange. (mount: applet not found)
To be sure i'm doing all that stuff without ssh.
Edit:
For everyone else reading this. It's not about music, the musicfolder is just a random folder to see if it's working.
the1weasel said:
Thanks for the response, looks like you are much more into that android thing....
I just added
"10.11.12.10:/volume1/Audio /storage/emulated/0/Music/remote nfs nolock,ro defaults"
to the fstab.qcom . Doesn't mount at startup.
I realized some inconsitency in the ssh thing, sometimes it works mounting via ssh, sometimes not....strange. (mount: applet not found)
To be sure i'm doing all that stuff without ssh.
Edit:
For everyone else reading this. It's not about music, the musicfolder is just a random folder to see if it's working.
Click to expand...
Click to collapse
To add to that: It doesn't seem like any surprise that just putting an entry in the fstab.qcom doesn't work the same as the others. As I search around for a way to do this it becomes apparent that even a Synology app designed to do this (DS File) (Mounts a NFS share on Synology box and allows file transfers) isn't able to allow others to see it's mounted share.
Before I mounted a Synology folder using Synology DS File, I created a tmp folder and cd there and then did a mount > mountbefore.log. After the mount of the share while still running DS File pointing to my Synology folder, I did a mount > ./mountafter.log. I then did a diff -urN (and just a diff) ./mountbefore.log ./mountafter.log that showed no differences. That seems telling.
Also, I did the same with /proc/mounts /proc/mountinfo /proc/mountstatus before and after, and nothing showed up as different. Also I did a ps | grep DS to see whether the ps output gave me any clue as to what local mount point was used, but though I could see the DS process, I couldn't see it's mountpoints.
I'm pretty sure there's an SELINUX (or many) entrie(s) for the mounted share that prevent the usual visibility. I recall reading that "fixing" the /proc exploits was a big priority with the advent of SElinux so I'll look at that angle too. I don't think that the fact that DLNA works is of much use in this problem. It's really a solution to a different and specific problem.
hachamacha said:
To add to that: It doesn't seem like any surprise that just putting an entry in the fstab.qcom doesn't work the same as the others. As I search around for a way to do this it becomes apparent that even a Synology app designed to do this (DS File) (Mounts a NFS share on Synology box and allows file transfers) isn't able to allow others to see it's mounted share.
Before I mounted a Synology folder using Synology DS File, I created a tmp folder and cd there and then did a mount > mountbefore.log. After the mount of the share while still running DS File pointing to my Synology folder, I did a mount > ./mountafter.log. I then did a diff -urN (and just a diff) ./mountbefore.log ./mountafter.log that showed no differences. That seems telling.
Also, I did the same with /proc/mounts /proc/mountinfo /proc/mountstatus before and after, and nothing showed up as different. Also I did a ps | grep DS to see whether the ps output gave me any clue as to what local mount point was used, but though I could see the DS process, I couldn't see it's mountpoints.
I'm pretty sure there's an SELINUX (or many) entrie(s) for the mounted share that prevent the usual visibility. I recall reading that "fixing" the /proc exploits was a big priority with the advent of SElinux so I'll look at that angle too. I don't think that the fact that DLNA works is of much use in this problem. It's really a solution to a different and specific problem.
Click to expand...
Click to collapse
Hmm I just found this: https://forum.xda-developers.com/showthread.php?t=2106480 and will have a closer look into it later, I'm running out of time right now and have to leave.
But what I've read so far looks similar to the problem we are facing right now. Maye thats the way to go. I'll try it, as I said, later.
At this point i don't even care if it's smb or nfs as long as i can mount my stuff into the filesystem.
One other thing I noticed but haven't messed around with yet is that I was looking at the various mount commands for different implementations (not that any will just work like 2 versions ago), and noticed that only /system/xbin/mount is a soft link to /system/xbin/busybox (standard busybox link to allow using it various look-alike-to-linux commands.
But then I realized that /system/bin/mount is also there, also a soft-link to /system/bin/toybox (another busybox clone) and am wondering if it behaves any differently. Might be worth a look (but I doubt it). /system/bin/toybox is at least a different version of busybox and not linked to it.
Just looked at your last reply and realized that unfortunately the two links of interest are at the now nonexistant domain cyanogenmod.org. Maybe the diffs are worthwhile. Gotta work, Later.
hachamacha said:
One other thing I noticed but haven't messed around with yet is that I was looking at the various mount commands for different implementations (not that any will just work like 2 versions ago), and noticed that only /system/xbin/mount is a soft link to /system/xbin/busybox (standard busybox link to allow using it various look-alike-to-linux commands.
But then I realized that /system/bin/mount is also there, also a soft-link to /system/bin/toybox (another busybox clone) and am wondering if it behaves any differently. Might be worth a look (but I doubt it). /system/bin/toybox is at least a different version of busybox and not linked to it.
Just looked at your last reply and realized that unfortunately the two links of interest are at the now nonexistant domain cyanogenmod.org. Maybe the diffs are worthwhile. Gotta work, Later.
Click to expand...
Click to collapse
I'm back home already a little late but enaugh time for more researches.
This link:
https://github.com/mkasick/android_...mmit/b358bf82c079a577f011c167da8b65faef73a06e
is working. And really worth reading it and explains the visibility problem.
mkasick said:
Android 4.2 breaks Dalvik-apps that mount file systems to be shared with other apps. This includes CifsManager, Mount Manager, essentially anything that mounts cifs shares, FUSE file sytems, etc. The symptom is that the mounted contents appear fine to app that peforms the mount operation (assuming the app itself provides the ability to browse the contents), but every other app only sees an empty directory at the mount point.
It turns out that this problem is a side-effect of the approach used to implement multi-user storage in Android 4.2. I've explained the problem in detail in the commit log for a Gerrit issue we're reviewing for CyanogenMod 10.1 that addresses the problem:
Ideally, any 4.2 ROM can provide support for CifsManager by applying a change to Dalvik, and a second change to the boot ramdisk's init.rc:
Dalvik change: Zygote: Restrict slave mountspace so Dalvik apps can mount system-wide volumes
init.rc change: init.rc: Create /storage mountpoint so Dalvik can mark as slave in zygotes
Alternatively, ROMs that can't/prefer not to use a source-build Dalvik (libdvm), I've also provided a kernel patch that implements a similar workaround within the kernel. It also requires the above init.rc modification:
Kernel commit: Restrict slave mountspace so Dalvik apps can mount system-wide volumes
init.rc change: init.rc: Create /storage mountpoint so Dalvik can mark as slave in zygotes
With either of the above two fixes, CifsManager et al. should work when using a mountpoint outside /storage (and /mnt/shell/emulated). I'd recommend using "/mnt/cifs" or something similar. Attempting to mount inside /storage retains the previous behavior where the mount can not be seen by other apps.
Note that ROMs only need one of the above two fixes, although they are compatible with each other and will function correctly if both are present. The Dalvik approach is preferred over the kernel workaround where feasible. Attached are the three patches referenced in the issues/commits.
Attachments: (sry for editing the quote)
dalvik.diff: https://forum.xda-developers.com/attachment.php?attachmentid=1656555&d=1358548352
nitrc.diff: https://forum.xda-developers.com/attachment.php?attachmentid=1656556&d=1358548352
kernel.diff: https://forum.xda-developers.com/attachment.php?attachmentid=1656557&d=1358548352
Click to expand...
Click to collapse
Look at the attached files, the answer is in there, but i don't know what to do with it
Thanks. I've got to do some work from home before I go back to messing around with this. I read the zygote/Dalvik page. I'm sure I've read it before but had the impression that the information was obsolete, but maybe not!
I guess there a couple of problems for me with that information.
1) It is pretty old (2013 or so): I can't even find the pertinent file in my source tree anymore.
2) dalvik has undergone a lot of revisions since this was tried. I'm not at all sure the change looks very different from the way tmpfs is /storage mounted already.
(but I could try this one. I figure in real time, if it'd let me remount it with the changes, the worst it could do is lock me up).
3) the kernel I'm using doesn't appear to have that line in it, besides, I'd have to rebuild the kernel.
I guess I'd much rather find a userspace way around this problem if possible. I seems almost unthinkable that there'd be no other way (via the mount cmd for example and careful choice of mount folder) to mount something that could be seen by any process. I'll keep trying from that angle.
Regrouping: I was ssh'd into the synology server poking around when I noticed that the running nfs daemon (as shown by ps -ef | grep nfs) was nfs4. I didn't see that Android supported that so I decided to just move the entire exercise of mount.nfs4 over to Ubuntu 16.04 box.
I made sure I had all the NFS stuff installed and pretty much did these statement:
mount -t nfs -o ro x.x.x.x/share /mnt/remote # failed with bad argument
mount -t nfs4 -o ro x.x.x.x/share /mnt/remote # failed with bad argument
mount.nfs4 x.x.x.x/share /mnt/remote #failed with bad argument.
At that point I decided that android didn't matter if I couldn't figure out how to mount NFS shares from linux.
I then tried mount -t cifs -o ro,user=me,pass=pwd //server/share /mnt/remote
It mounted up immediately. I need to look up some working examples of someone using mount.nfs / 4 from anywhere to synology. While I'm sure I've used it before, I'm also pretty sure I don't recall how exactly the setup and syntax works.