yashsingh1/xdaforums huggingface dataset:
[Nexus 7 General] flumpster:
One word of warning because I know a mate of mine did this by accident.

If you have a share set up on your computer with full read/write access and then wipe your SD card on android (or just delete the shares folder in your file manager) while the share is mounted in cifs manager then it will also delete the folder on your computer.

I don't have this worry because all my shares on computer are set up as read only to stop the kids accidentally deleting stuff.

Just a warning ;)
[Nexus 7 General] Salty Wagyu:
Thanks for the instructions flumpster, helped a lot.

Might also advise on mounting outside of /sdcard, was seeing a lot of LAN traffic and Nexus 7 activity - turned out a number of apps were creating thumbnails and/or indexing items that was on my NAS drive. Poweramp, Gallery, QuickPic etc.
[Nexus 7 General] Hemidroids:
File Manager HD (Tablet) can play / view any type of file over SMB. Very simple.
[Nexus 7 General] flumpster:
So can ES file explorer which we already mentioned but that is not what we want.

This makes the folder ( or folders ) appear local so you can add it into any other app directly (mx player, movie browser hd, gallery, play music, etc)

---------- Post added at 08:11 AM ---------- Previous post was at 08:06 AM ----------

I have not tested this but have you tried putting a .nomedia file inside the "Shares" folder after it is first created? In theory it should stop them apps doing that.
[Nexus 7 General] xdadevnube:
@ OP

Thank you! This is exactly what I was looking for. I don't even have my order yet (was merely hoping for CIFS support), but this is about the only thing that makes this 8GB tablet usable, IMO.

I will provide feedback once I get the tablet in hand and have some time to experiment with CIFS.
[Nexus 7 General] martyg7:
Just wondering how these mounts behave as the tablet is moved around in/out of WiFi coverage and between LANs.

Is everything well-behaved? Any gotchas I should be aware of?
[Nexus 7 General] vorcers:
<please delete>
[Nexus 7 General] jiujitiancai:
Is there anyone make a step-by-step guide?

it will help lots of noob like:rolleyes:
[Nexus 7 General] hugo5:
Workaround not working ...

So I tried to replace the mount and umount commands in /system/bin with your scripts, set the permissions and the owners right, but could not get the command to work.

It would be highly appreciated if you provided us a little more detailed instructions on how you made your scripts to work. Moreso, a little information would also be nice on the kernel, the rom and if applicable the cifs.ko you used.

Thanks in advance!

Hugo
[Nexus 7 General] spthacker:
anybody got the cif modules for the new 4.2.1 roms please?
[Nexus 7 General] Sigvic:
The modules were uploaded by chrkad to the thread at reviewlagoon.com. I can't post url's yet but a simple Google search should find it.

I was able to get it partially working yesterday, but as others have noticed the shared folder was not persistently available, apps that were not open at then time of the mounting only saw empty folders for example. This was using the tactic of replacing the mount and umount commands posted earlier in this thread, and mounting with cifsmanager.
[Nexus 7 General] ozgreg:
CIFS (modules) are available in CM 10.1 in /system/lib/modules and I can get a CIFS mount to work using cifs manager but it returns empty directory which is consistent with what I have already read here.. The one thing that I have found is mount in 4.2 will set the CIFS mount directory permissions as root, root, prior to 4.2 permissions got set as 1000,0.. I am pretty sure this is part of the issue..

mounting via ADB busybox mount (as already discussed here) has the exact same issue so I am unconvinced that the busybox mount is a viable solution for CM 10.1 roms..
[Nexus 7 General] bubbleguuum:
This is exactly what I observed too. Mounting with local ADB works but the mounted directory will only appear in apps whose process was already started before the mount. New launches do not see the mounted directory.

Does anyone who has a good grasp of kernel mount namespaces and how they progapate, could give a technical explanation of this behaviour ? Is there any workaround that does not involve modifying boot scripts ?

Every root app that deal with mounting filesystems (whatever they are) have this issue on 4.2+.
[Nexus 7 General] NicoGa:
The software stickmount for USB otg had the same problem at first with 4.2.1, but this was solved. Maybe chainfire (the developer of stickmount) can help you ?

Envoyé depuis mon Nexus 7
[Nexus 7 General] bubbleguuum:
Does StickMount works even if mounting happens before the target app (file manager, ..) is launched (I mean a fresh process started, not reused) ?

I cannot test it since I have no OTG cable.

But from what I know of the StickMount method (which I tried), there is still the same problem (only works if mounting happens after target app is started).

After studying how the zygote process spawn apps I've found a workaround, but as it implies breaking some apps it is not really usable.
[Nexus 7 General] NicoGa:
At first it was as you described but then chainfire fix it, and now you don't need to open the program before connecting the USB cable ... Or in other words, mounting can happen before the targeted app is started.

Envoyé depuis mon Nexus 7
[Nexus 7 General] ozgreg:
I have gotten CIFS to mount on CM 10.1 Nightly build by using the already compiled cifs.ko in CM 10.1 and using the busybox mount script created by XDA member H3g3m0nto to mount my CIFS on /storage/usbdisk and yes ANY application can see my files etc regardless of when the application is started.. (IE you can start up for example ES File Explorer after the mount script and it will see the share fine..)

I believe this is due to the fact I am using a hard mount point that is created by init.rc.

I also added uid=1000, gid=1015 to the mount statement which resolved the permissions issue I was seeing when trying to access the CIFS via an App. The modified mount code is as below..

MOUNT_CMD="\
busybox mount -t cifs -w \
\
-o	\
user=$USERNAME,\
password=$PASSWORD,\
uid=$UID,\
gid=$GID,\
unc=\\\\\\\\\\\\\\\\$IPADDRESS\\\\\\\\$SHARE \
\
//$IPADDRESS/$SHARE \
$MOUNT_POINT"
[Nexus 7 General] farhanito:
Guys, you might want to look at this..

http://xdaforums.com/showthread.php?t=2062768
[Nexus 7 General] glimmling:
Or directly here:

http://xdaforums.com/showthread.php?t=2107224

;)
[Nexus 7 General] e-ghost:
Any method that can enable CIFSManager mount without using non-stock kernel? I used custom kernel before but after an accidental OTA update, I lost everything so I would like to avoid using non-stock kernel.

Or there are non-stock kernel that only added CIFS (better add exFAT support as well) without changing the core structure thus even OTA update afterward will not cause issue?

Thanks a lot! :good:
[Nexus 7 General] jmtw000:
Sorry for not responding sooner. I don't frequent these forums too much and for some reason I stopped getting notified of new posts here. But, I see some of you are having trouble with the mount/umount scripts. I'm not sure what to tell you guys as I've been using them for months on my rooted stock Nexus 7. I do notice that sometimes I have to mount/unmount the share a few times in Cifsmanager before it actually takes. I think this may have something to trying to use ADB before it's been fully restarted. Cifsmanager will still report that the share has been mounted successfully (because it was able to run the mount command, even though it didn't do anything because ADB is not up yet). I usually just try it a few more times and it eventually works. I'm going to be doing the latest OTA update on my Nexus 7 soon (maybe this weekend if I have time) and so will have to set this all up again. I'll post the new kernel modules (if the kernel version is different), see if I can get it working more smoothly (delay the script until adb is more likely to be restarted or something), and post a more detailed guide for those who don't know what they're doing with the scripts :p Stay tuned...
[Nexus 7 General] adxgrave:
Any news?
[Nexus 7 General] jmtw000:
OK, I think I finally got it working again in 4.2.2. Google changed adb so you need to use the RSA authentication now, which makes doing this EVEN MORE difficult. But, thanks to the posters over at http://code.google.com/p/android/issues/detail?id=48126 I got it working. So, here's the step by step guide I promised to get CifsManager working in 4.2.2. Attached you will find the new kernel modules and the mount/umount scripts.

Disclaimer: I have no idea what I'm doing and don't claim to. Follow this guide at your own risk. I take no responsibility for anything that gets messed up.

1. You need to have a rooted Nexus 7 (Duh!) and you need to have busybox installed (as google broke something in toolbox which now segfaults when you try to mount CIFS shares).

2. We need to create the public/private RSA keys for ADB and append the public key to /data/misc/adb/adb_keys.

Open a terminal on your Nexus 7 and run these commands:

su
adb kill-server
export HOME=/sdcard
setprop service.adb.tcp.port 5555
adb start-server
cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
stop adbd
start adbd

That should fix ADB to allow you to connect locally. Note that there will now be a .android directory on your sdcard. Don't delete this or you'll break ADB and mounting CIFS won't work.

3. Check to make sure you can connect locally to the device through adb. In the same terminal you ran the above commands in run:

adb connect localhost
adb devices

You should see something like:

List of devices attached
localhost:5555 device

If not something's wrong.

4. Now, we need to replace the mount/umount links with the attached scripts. Download the attached file and unzip it to your sdcard. Then run the following commands in the same terminal you used above.

busybox mount -o rw,remount /system
rm /system/bin/mount /system/bin/umount
cp /sdcard/mount /system/bin/
cp /sdcard/umount /system/bin/
chmod 755 /system/bin/mount
chmod 755 /system/bin/umount
busybox mount -o ro,remount /system

5. In CifsManager's settings, check "Load cifs module" and "Load via insmod". Then set "Path to cifs.ko[:<modpath>]*" to "/sdcard/modules/cifs.ko:/sdcard/modules/md4.ko:/sdcard/modules/nls_utf8.ko"

6. Create your share in CifsManager and under options put "rw,file_mode=0777,dir_mode=0777,uid=1015,gid=1015" (and any others you may need) . For the mount point, the mount script creates a dir "/cifsmnt", and 10 mountpoints under it (0-9). You can use these for your different shares. If you need more mount points, edit the dirnum variable in the mount script.

That's it, you should be able to mount your shares and access them from any app :fingers-crossed:
[Nexus 7 General] xbox1513:
I could not get this to work on AOKP 4.2.2. I am running rootbox 2.0. When I mount using cifs manager, and refresh, it automatically unmounts. The /cifsmnt dir is empty.
[Nexus 7 General] jmtw000:
I'm not running AOKP, so I don't know exactly what your issue may be. But, when you say the /cifsmnt dir is empty, do you mean there are no dirs (0-9) under it at all? The mount script should be creating those. It would be odd that it would create the /cifsmnt dir but nothing under it. It could be a permissions problem. Maybe try to run the mount script manually from a root terminal and see what happens. You don't have to actually mount anything with it. Just delete /cifsmnt, and run mount, that should be enough to at least give you some idea why it can't create/set permissions on those dirs, if that is where it's getting hung up. Also, do you have a /system/bin/sh? If that's not there the mount script probably won't work correctly.

Some other things to consider; Does your kernel either have cifs modules or cifs support built in? The modules I compiled and attached to my post will not load on AOKP unless it's using the same kernel version and build number, which I'd imagine it wouldn't be. Do you have busybox? The mount script specifically calls busybox, if it's not there it won't work. Were you able to get ADB set up for local connections? Mounting won't work if this isn't working first.
[Nexus 7 General] xbox1513:
I can see ADB devices in terminal, but it goes off automatically when i mount using cifsmanager. I have busy box installed. I see the directory created in /cifsmnt/0 by the mount script, but nothing is being mounted. I see /system/bin/sh and its a link file.
[Nexus 7 General] jmtw000:
OK, that tells me the part of the script which creates the directories is working at least.

So, if you run the following in a root terminal:

export HOME=/sdcard
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb connect localhost
adb devices

You see something like this:

List of devices attached
localhost:5555 device

Right? It doesn't say "offline" does it?

If that's all good, my next guess would be that there may be something wrong with your modules/cifs support in the kernel. Does your kernel have cifs support compiled in or are you using modules? Like I said earlier, you probably can't use my modules unless your kernel version matches 3.1.10-g05b777c. What is your kernel version?
[Nexus 7 General] xbox1513:
I finally got it working. My issue was i was starting adb manually. Once i restarted and just ran cifsmanager to mount, everything worked just fine. Thanks for the script and tutorial jmtw000.
[Nexus 7 General] jmtw000:
Glad to hear it.
[Nexus 7 General] xbox1513:
I was able to get it to work on aokp using your modules. I do have faux15 b1 kernel, but cifsmanager is set to use your modules.
[Nexus 7 General] flamand:
I'm on stock kernel. I run into a problem pretty quickly. I get as far as:

su

adb kill-server

export HOME=/sdcard

setprop service.adb.tcp.port 5555

adb start-server​

the messages then are:

* daemon not running. starting it now on port 5038 *

* daemont started successfully *​

If I go on and then look at /data/adb/misc, there is a file adb_keys.

However, when I list devices, nothing is there.
[Nexus 7 General] jmtw000:
You did copy the new key from /sdcard/.android/adbkey.pub and put it in /data/misc/adb/adb_keys and restart adbd, right?
[Nexus 7 General] flamand:
Thanks, that really got things moving. I guess the copy didn't happen because the daemon port reassignment didn't work. From there everything is just as in your instructions.

Unfortunately it's still not working. When I mount the share in CifsManager, it says it mounted successfully and the green light is on. If I tap on the share it goes to ES Explorer and /cifsmnt/0 is empty. When I go back to cifsmanager, the green light is out and the share has been unmounted. I restarted the device but that didn't change anything.
[Nexus 7 General] jmtw000:
It sounds like you may have messed up the adb part somehow. If that's not working, the rest of it won't. See my post at http://xdaforums.com/showpost.php?p=38825937&postcount=201, run those commands, and see if you're seeing the device listed and not "offline". If it's not showing like it should, please go back and follow the instructions in step 2 and 3 here http://xdaforums.com/showpost.php?p=38507798&postcount=197.
[Nexus 7 General] flamand:
adb connect localhost​

returns: connected to localhost:5555

adb devices​

returns: List of devices attached / localhost:555 device

That's what I should see, right?

I'd love to get cifsmanager working, but I just discovered that ES Explorer will let me access the shares. Your must have made that happen. If you have any other ideas to help me with cifsmanager, that would be great. In the meantime, thanks!!
[Nexus 7 General] jmtw000:
Yes, that's what you should see. That means adb is configured properly. I'm not sure why Cifsmanager would not be working. Check to make sure the modules are loading. And try mounting the share from the command line to see if it gives you any indication of what might be wrong.
[Nexus 7 General] flamand:
Everything looked fine, so I decided to start over. Flashed stock & unrooted, rooted again, set up SU again, set up busybox again and finally cleared data for cifsmanager and redid it. Not sure where the problem was, but now it works!

Thanks again for your great help and for doing this in the first place. :)
[Nexus 7 General] s0nik:
Hi, the above works for me. I have stock kernel 3.1.10-g05b777c, but i'm not able to create a key. There's no .android on my sdcard..

Typed the commands several times, but nothing has been created. Is this due to the stock kernel?
[Nexus 7 General] jmtw000:
Hi, it works just fine on a stock kernel. That's what I'm using. What exactly do you mean by "the above works for me"? You do know that the commands you quoted above do not create the key, right? Step 2 from my instructions at http://xdaforums.com/showpost.php?p=38507798&postcount=197 will create and copy the key.
[Nexus 7 General] godashram:
i get a similar issue, but don't even get the dir cifsmnt at all. using adb connect localhost and adb device list all appears online and correct... cifs manager says mounted, but moving away from the screen and then coming back shows that it's not
[Nexus 7 General] jmtw000:
Try running the mount script manually and see what happens. Check the system log, I use logwrapper in the mount script. It might give you some clue as to when's happening.
[Nexus 7 General] godashram:
Not sure as to how to run it manually, but while reading, I took a break and looked around and found cifsmnt.... I just expected it under /sdcard, not requiring need a root explorer to actually find it....

Update... Put on my thinking cap.....and realized cifsmanager was trying to mount it at /mnt/cifs/name.... Added sdcard between /mnt and /cifs and it worked!

now a small problem.... with my NAS (dlink 323), apps can see all my files and directories on my home network. on my seagate satellite, running hackseagatesatellite firmware and password protected, it will connect, but not see anything. pretty sure it's the goflex satellite though.

also, other apps cannot see the shares....
[Nexus 7 General] jmtw000:
Finally getting around to upgrading my Nexus 7 to 4.3. New modules and an updated script (busybox changed where the binary is installed) coming soon...or not. See my post here for details and a hack to get it working.
[Nexus 7 General] hun-szap-an:
Not succeded

Dear ozgreg!

I have tried your method, but was not successful.

CIFS manager succeded, (green) but if I leave the app (doesn't matter exit or "HOME") then any application I tried no shares found.

Afterward I entered again the CIFS manager, and noticed the mount already "gone", the mounting "light" is grey.

Restart, etc some times, but no final result.

Thank you for your answer in advance,

---------- Post added at 11:56 AM ---------- Previous post was at 11:33 AM ----------

Sorry, I am a newbie, but has the same problem.

How to run manually (I guess to type it into a terminal window, please confirm...)

Where can I find the log file generated?

Thank you in advance,
[Nexus 7 General] flumpster:
If your not in range of wifi it's obviously not going to connect to the network share.

As for a different LAN I don't know what your really trying to ask? If you have a share set up for one LAN it's not going to work on the other one because it will have a different local IP and share name probably. So you would just set up a different share (or shares) for that LAN.
[Nexus 7 General] Salty Wagyu:
Some apps seem to throw a fit if my network share is offline (my HTPC is automatically set to shut down at 3am and start up at 6pm), Root Explorer/ES File Explorer and MX Player locks up when there's an offline share, so I've stopped using CifsManager for this reason :(
[Nexus 7 General] bsw11:
This is great. Though so far not needed as there is a wonderful overclocked kernel in the Org Dev that has it built in. But always good to have around if an new kernel shows up without it.

Also Mount Manager Pro has a bunch of better auto mount features for those that might want it.
[Nexus 7 General] Kermee:
Thanks for the modules and write-up, OP.

I'm getting about 8Mbit/sec (~1MB/s) transfers over SMB (802.11n 2.4 GHz to a D-Link DIR-825). What's the expectation on the speed of CIFS transfers between a GbE NAS and the Nexus 7? I can play non-HD files off my NAS with MX Player just fine... Once I step up to HD files, it's too slow.

Cheers,

Kermee

EDIT: Looks like the SMB transfer speeds for the Nexus 7 is what others are seeing... -- Nexus 7 Q&A: Wi-Fi LAN Transfer Speeds http://xdaforums.com/showthread.php?t=1783591
[Nexus 7 General] qwerp_:
TBH i am not exactly sure myself, i just compile the module from the source, and has done no modification to it.

let me re-visit and check to see if there is anything can be done.

its struggling abit to stream 1080p video at the moment. but no issue at all for normal avi.
[Nexus 7 General] qwerp_:
i have recompiled a new cifs.ko with a larger rsize (read buffer). please give it a try.
[Nexus 7 General] jrpbulk:
Interesting Thread

CIFS for me relates to the CIFS/SMB Ms protocol that i see as a network engineer good stuff
[Nexus 7 General] Kermee:
Awesome. Thanks. I'm doing some preliminary testing right now and seeing the same results. Anywhere between 600KB/s to about 800KB/s.

I've dropped to shell and I'm playing with the mount settings right now, but I see the rsize as 130048 in /proc/mounts.

Cheers,

Kermee
[Nexus 7 General] Kermee:
I've been testing the new CIFS module by manually loading it with the option CIFSMaxBufSize=130048 and manually mounting with the option 'directio,rsize=130048,wsize=130048' and I'm getting a bit better transfer speeds. 1.2MB/s-1.5MB/s now. Still not enough for me to stream HD, but the previous stuff that I was streaming that was 'almost' streamable is stable now.

On a MacBook Air over WiFi to the same AP using the same CIFS share yields 10MB/s.

If I can get it to near 3MB/s CIFS read performance on the Nexus 7, I'd be in the clear. Curious to see what other people are getting.

Thanks, OP!

Cheers,

Kermee

P.S. During the CIFS/SMB file-transfer tests, I was monitoring CPU and IOWAIT in another Terminal. Nothing out of the ordinary; CPU and IOWAIT were low/negligible and fine. It's just the nature of CIFS/SMB in general unfortunately.
[Nexus 7 General] qwerp_:
i will see what else i can find and tweak to make this faster.
[Nexus 7 General] StuMcBill:
YESSSSSSS! IT WORKS!!

I have been trying to do this for ages!!

Is there anyway I can back up these files and Cifs Manager setup between ROM Flashes?

Thanks

Stewart
[Nexus 7 General] flumpster:
The 3 files are the easy part to put back when you change rom. As for cifs manager I would guess that if you back it up in titanium backup with its data you should be able to restore to new rom with all your settings intact.
[Nexus 7 General] qwerp_:
hi stewart,

as in the original post stated.

this is kernel specific.

so, if you are running a different kernel version, this module will not work for you. hence, i don't see the need to backup it.
[Nexus 7 General] qwerp_:
the issue is, in kernel 3.1.10, async read is not implimented in the cifs.

i am trying to hack async read into it to see if it first of all work, and second of all improve.

else we will need to wait for google to upgrade the kernel version to anything 3.2 or newer.
[Nexus 7 General] thankyousam:
These modules have got the mounting working, which is great but I'm not able to mount a directory within a network share to a local directory.

For example 192.168.1.168/Volume_1 works, but 192.168.1.168/Volume_1/music results in an error. Should/does CIFS support this kind of deep linking?

I've got the latest version of he cifs.ko if it makes any difference.
[Nexus 7 General] qwerp_:
the mount command will work with the sub directory.

but unfortunately i did not write "cifs manager".

if you can find a app that does isuue the correct mount command, then it can work.

eg, stated here.

https://bbs.archlinux.org/viewtopic.php?id=124128

and

http://www.wenyu.info/?p=92

the latest cifs.ko is to speed up the read speed. has nothing to do with the mount.