FORUMS

[Q] cifs mounting problem with android 4.3

6 posts
Thanks Meter: 0
 
By uentity, Junior Member on 2nd September 2013, 08:35 PM
Post Reply Email Thread
7th October 2013, 05:51 PM |#11  
Junior Member
Flag Minneapolis
Thanks Meter: 8
 
More
Quote:
Originally Posted by slano

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?

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...
17th October 2013, 11:18 AM |#12  
gwodus's Avatar
Junior Member
Thanks Meter: 8
 
More
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

The Following 4 Users Say Thank You to gwodus For This Useful Post: [ View ] Gift gwodus Ad-Free
18th October 2013, 01:57 AM |#13  
Junior Member
Flag Minneapolis
Thanks Meter: 8
 
More
Quote:
Originally Posted by gwodus

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

Thank you for the detailed response, I will give that a try.

Sent from my Nexus 10 using xda app-developers app
19th October 2013, 10:26 AM |#14  
gwodus's Avatar
Junior Member
Thanks Meter: 8
 
More
Quote:
Originally Posted by c683

Thank you for the detailed response, I will give that a try.

Sent from my Nexus 10 using xda app-developers app

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.
20th October 2013, 10:34 PM |#15  
Junior Member
Flag Minneapolis
Thanks Meter: 8
 
More
Quote:
Originally Posted by gwodus

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.

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.
The Following User Says Thank You to c683 For This Useful Post: [ View ] Gift c683 Ad-Free
21st October 2013, 02:51 AM |#16  
gwodus's Avatar
Junior Member
Thanks Meter: 8
 
More
Quote:
Originally Posted by c683

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.

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
6th November 2013, 08:22 PM |#17  
ludalex07's Avatar
Senior Member
Thanks Meter: 54
 
More
Quote:
Originally Posted by gwodus

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

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?
11th November 2013, 10:25 PM |#18  
Senior Member
Thanks Meter: 83
 
More
Same problem here on 4.4 N4

Sent from my Nexus 4 using Tapatalk 2
5th December 2013, 10:05 PM |#19  
Junior Member
Thanks Meter: 0
 
More
root only problem
Quote:
Originally Posted by ludalex07

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'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=gue st,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?


5th December 2013, 10:58 PM |#20  
Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by noktilux

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=gue st,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?


The debugger method is described here: http://forum.xda-developers.com/show...8&postcount=55

Not sure it will work on 4.3, but you can give it a try.
6th December 2013, 01:24 AM |#21  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by slano

The debugger method is described here: http://forum.xda-developers.com/show...8&postcount=55

Not sure it will work on 4.3, but you can give it a try.

thanks for that, but can you suggest another service/process to hijack i ask because i don't think debbuggerd is run on start. how can i tell? it is not in the services when i lst them.


cheers.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes