CIFS Mount on Tablet Z working! (stock 4.1.2 confirmed, 4.2.2 testers wanted) - Xperia Tablet Z General

Hello,
since I have my Tablet Z I was searching for a solution to be able to mount CIFS directories (e.g. from a NAS) on my Tablet Z, since certain media apps (especially music players with own database like GoneMad or Poweramp) only work with local directories.
Unfortunately no dev seems to be interested in compiling the necessary kernel modules or making a custom kernel with the functionality included. And myself I'm no dev.
But today - hooray - I saw this thread http://forum.xda-developers.com/showthread.php?t=2260831 and thought: "There are more programs from other phones, especially the very similar Xperia Z, that work on the Tablet Z, so just let's try!"
I downloaded the package linked in the first post of the thread - the .350 one. (The .423 one didn't work). Then I unpacked it and copied the contents of the folder (some .ko and config files) to /system/lib/modules.
Then I opened a terminal, cd'ed to /system/lib/modules and entered "insmod cifs.ko". Worked!! :good::cyclops:
Next I mounted my network share with the totally normal command (not with the "unc:\\\\"-stuff suggested in the above thread to get it working on the Xperia Z):
Code:
busybox mount -t cifs -o iocharset=utf8,username=xxxxx,password=yyyyy //x.x.x.x/[my share] [mount point]
Voila!
(NFS doesn't work, insmod gives an error.)
But now I can use GoneMad Music Player with my Intenso WiFi Harddisk :good::good::good:
Since I am still on 4.1.2 (with no plan to update to higher versions yet, because for me 4.2 or 4.3 has drawbacks on this device), I don't know whether one of the two module packages from the Xperia Z thread would also work on 4.2.2.
It would be great if someone who has this version running could test it.
Best Wishes,
Hasenbein

Perfect! This was the my last missing function on Tablet Z
Successfully tested on SGP321 (LTE) 10.1.1.A.1.307

Hi,
I have a Sony SG311 over 4.2.2 stock rom. If I copy these files on my tablet, Can i use CIFS manager app to mount directly my NAS share folders ?
Thansk for help

Yes, if it would work on your ROM then of course you could use CIFS manager.
But up to now nobody has got it working on 4.2.2, only on 4.1.2.
It would be great if you could test it by following my instructions. Thanks!

hasenbein1966 said:
Yes, if it would work on your ROM then of course you could use CIFS manager.
But up to now nobody has got it working on 4.2.2, only on 4.1.2.
It would be great if you could test it by following my instructions. Thanks!
Click to expand...
Click to collapse
Hasnt worked for me on 4.2.2
Always get "invalid argument" error whether I do it manually in terminal or using Cifs manager. It wont mount my network drive.
Hope someone has a solution soon.

sneakymise said:
Hasnt worked for me on 4.2.2
Always get "invalid argument" error whether I do it manually in terminal or using Cifs manager. It wont mount my network drive.
Hope someone has a solution soon.
Click to expand...
Click to collapse
Same to me

hasenbein1966 said:
(NFS doesn't work, insmod gives an error.)
Click to expand...
Click to collapse
You can try brute-force loading it via punchmod instead of insmod, that usually works if the module isn't compiled for a completely different device.
Some info here: http://forum.xda-developers.com/showthread.php?p=41920265#post41920265

OK, could you 4.2.2 users try insmod -f first (normal force loading via -f parameter), then look with lsmod whether the module has been loaded, and if it didn't work, try punchmod? That would be great! Thanks!

Related

How can I mount a NFS share?

Hi,
Im using Cyanogenmod 5.0.8 on my htc Dream (G1).
I want to mount my NFS share with my music collection just as i do it with my pcs.
Code:
su
mount -t nfs 192.168.1.102:/media/media /sdcard/media
mount: mounting //192.168.1.102/media/media on /sdcard/media failed: No such device
Whats wrong?
Is there no NFS client support in the kernel?
Thanks,
Foyaxe
Unfortunately, this post probably comes way too late for the original poster, but it may be useful for anyone else, like me, who stumbles across this thread looking for a way to mount nfs on Android devices.
The answer is to use busybox.
There is support for nfs version 3 in the kernel, but the standard mount command seems to have been hobbled. The busybox mount command seems to work exactly the same as the standard linux mount command (except that it actually works on Android )
After downloading busybox from the Android Market, this is the command I use:
Code:
busybox mount -o nolock,ro,hard,intr,vers=3 -t nfs 192.xxx.xxx.x.x:/your/nfs/share /mnt/sdcard/YourLocalFolder
I'm not sure how important all the options are, but I suspect that vers=3 is important at least. nolock, hard and intr are also useful when having problems mounting according to the mount man page.
Thailandian said:
Unfortunately, this post probably comes way too late for the original poster, but it may be useful for anyone else, like me, who stumbles across this thread looking for a way to mount nfs on Android devices.
The answer is to use busybox.
There is support for nfs version 3 in the kernel, but the standard mount command seems to have been hobbled. The busybox mount command seems to work exactly the same as the standard linux mount command (except that it actually works on Android )
After downloading busybox from the Android Market, this is the command I use:
Code:
busybox mount -o nolock,ro,hard,intr,vers=3 -t nfs 192.xxx.xxx.x.x:/your/nfs/share /mnt/sdcard/YourLocalFolder
I'm not sure how important all the options are, but I suspect that vers=3 is important at least. nolock, hard and intr are also useful when having problems mounting according to the mount man page.
Click to expand...
Click to collapse
I am getting 'failed invalid argument' ;(
Trying since quite a while now but won't work. Any more hints?
cheers,
ArneAC said:
I am getting 'failed invalid argument' ;(
Click to expand...
Click to collapse
Well the good news is that 'failed invalid argument' probably means that it's just a typing mistake or something similar. This should be fairly easy to solve.
One idea to check first - you need to create the directory that you want to mount your NFS share onto before you can mount it. If I remember rightly, failing to do that will give you an 'invalid argument' error.
Also, you will need to give the command root privileges - but I think you must have already done that or you would be getting a 'permissions' error rather than 'invalid argument'.
Failing that, I suggest that you copy and paste the command you are using here - although you should replace your server's ip address with x's as I did for security.
Then I can have a look at it to see if there's anything obvious.
Cheers
You can also use AndSmb from Market to connect to Windows shares or Samba shares on Linux.
ArneAC said:
I am getting 'failed invalid argument' ;(
Trying since quite a while now but won't work. Any more hints?
cheers,
Click to expand...
Click to collapse
I'm getting the same invalid argument. It is not a typo, but I don't know what the cause of the problem is.
in busybox, my commands are:
Code:
su
mount -t nfs 192.168.1.1:/DataVolume/Public ~/Downloads/temp/
adding or removing the various options such as "-o nolock,ro,hard,intr,vers=3"
does not make a difference.
It is not a problem with the local mount point -- that error is "no such file or directory".
This error is "failed: invalid argument" -- even with no arguments other than "-t nfs".
lsmod shows the modules loaded:
nfs 104232 0 - Live 0xbf036000
lockd 42336 1 nfs, Live 0xbf028000
sunrpc 150792 3 nfs,lockd, Live 0xbf000000
Can anyone help? Thanks.
P.S. I'm testing with NFS v3, but my ultimate goal is to connect to an NFSv4 server. Does busybox support NFSv4 mounts?
EDIT: it looks like this error "invalid argument" may be due to a conflict between versions of busybox and linux.
Found this here
This is how I interpret it.
kernel is newer - recompile mount command (i.e. busybox etc)
Make sure that it uses the headers from the kernel it will run with.
Click to expand...
Click to collapse
My linux is 3.0.8-GLaDOS-V1-15
My busybox is 1.19.3-Stericson
Any idea how to proceed?
I ran into this same issue on my new Acer A200 (busybox 1.19.3-Stericson) and my host server is using NFS V3. I'm wondering if your 3.0 server might be using NFS V4 and support is not enabled? Here is an excerpt from my /proc/config.gz on the Acer. Ideally V3 and V4 would have been set.
CONFIG_LOCKD=y
CONFIG_SUNRPC=y
CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
# CONFIG_NFS_V4 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
CONFIG_NFS_COMMON=y
Now I suppose in my case that if I really want this to work that I'd have to learn how to create a build environment and compile a nfs.ko myself.
EDIT: I just seen that you specifically stated you are testing w/NFS v3
acertabuser said:
Now I suppose in my case that if I really want this to work that I'd have to learn how to create a build environment and compile a nfs.ko myself.
Click to expand...
Click to collapse
That's what I'm thinking too.
In the mean time the short term solutions I'm considering are either samba (CIFS) or SFTP (i.e., the SSH file system). I've been using SFTP in the other direction (PC to phone) and it works great. I haven't test using it on the phone to mount the share from the PC yet, but I hope to do that this weekend.
Tried to nfs mount from a CM9 running galaxy nexus, kernel self compiled and surely contains NFS (client and server).
Doesn't work, the same way already described here.
Looking at the source and build intermediates, it appears to me that
1) the CM9 compiled busybox does not contain NFS mounting code.
2) busybox does not support mounting NFS v4 at all
Trying to compile busybox with nfs support builtin, breaks because several header files related to
RPC and portmapper appear to be missing from the android sources. Which is probably the reason why
NFS in not in the standard busybox mount...
Oh, how I wish nfs mounting were handled by the kernel, instead of relying on magic code in the userlevel mount...
brian_o'fish said:
Tried to nfs mount from a CM9 running galaxy nexus, kernel self compiled and surely contains NFS (client and server).
Doesn't work, the same way already described here.
Looking at the source and build intermediates, it appears to me that
1) the CM9 compiled busybox does not contain NFS mounting code.
2) busybox does not support mounting NFS v4 at all
Trying to compile busybox with nfs support builtin, breaks because several header files related to
RPC and portmapper appear to be missing from the android sources. Which is probably the reason why
NFS in not in the standard busybox mount...
Oh, how I wish nfs mounting were handled by the kernel, instead of relying on magic code in the userlevel mount...
Click to expand...
Click to collapse
Thanks for sharing your findings. Very interesting. I guess the next option would be to compile the mount command and use that rather than using the BusyBox mount...
works for me
MountainX said:
I guess the next option would be to compile the mount command and use that rather than using the BusyBox mount...
Click to expand...
Click to collapse
Well, there already _is_ nfs mount code in busybox, but it was configured away, because it needs the SUN RPC library, which is missing from Android / Bionic. That issue would probably also exist for mount.nfs from other sources, which would most likely also need additional porting work.
Thus, I snatched the librpc code from uClibc today, and meddled with it until it compiled in my copy of the CM9 sources. Got it to work! I can now NFS mount on my GNex, and the freshly built and installed update.zip was copied onto the device via NFS
I sent the changes to the cyanogen review system. That was my first contribution ever - I have no idea whether they will like it or not.
If you would like to try it out - and have a KERNEL with NFS support compiled in - send me an E-Mail, and I'll send you a statically compiled busybox (approx. 800k) back that you can play with.
brian_o'fish said:
Well, there already _is_ nfs mount code in busybox, but it was configured away, because it needs the SUN RPC library, which is missing from Android / Bionic. That issue would probably also exist for mount.nfs from other sources, which would most likely also need additional porting work.
Thus, I snatched the librpc code from uClibc today, and meddled with it until it compiled in my copy of the CM9 sources. Got it to work! I can now NFS mount on my GNex, and the freshly built and installed update.zip was copied onto the device via NFS
I sent the changes to the cyanogen review system. That was my first contribution ever - I have no idea whether they will like it or not.
If you would like to try it out - and have a KERNEL with NFS support compiled in - send me an E-Mail, and I'll send you a statically compiled busybox (approx. 800k) back that you can play with.
Click to expand...
Click to collapse
Congratulations! That's very cool! I just sent you my email address. I'm looking forward to trying your busybox. Good job getting this to work!
brian_o'fish said:
If you would like to try it out - and have a KERNEL with NFS support compiled in - send me an E-Mail, and I'll send you a statically compiled busybox (approx. 800k) back that you can play with.
Click to expand...
Click to collapse
I got it. Thank you! How do I use it? Do I just replace /system/xbin/busybox with your (renamed) statically compiled file?
I'm running the GLaDOS kernel which claims to have NFS support, so we'll see what happens. Since you and I have the same phone (GSM GNex), if this doesn't work, my next step will be to do exactly what you did and compile my own CM9. I have never done that before, so I would appreciate anything you can share about the steps you did. Thanks again!
MountainX said:
I got it. Thank you! How do I use it? Do I just replace /system/xbin/busybox with your (renamed) statically compiled file?
I'm running the GLaDOS kernel which claims to have NFS support, so we'll see what happens.
Click to expand...
Click to collapse
There is also the question of where you would put the mountpoint.
To test it out, (as root) I made a directory /data/data/de.bof.mounts/, copied
the busybox file there and made it executable (chmod 700 file), made a
subdirectory mnt there, and then ran './busybox mount -o nolock -t nfs SER.VER.I.P:/export/path ./mnt'
You can use the normal 'umount' command to unmount later.
Since you and I have the same phone (GSM GNex), if this doesn't work, my next step will be to do exactly what you did and compile my own CM9. I have never done that before, so I would appreciate anything you can share about the steps you did. Thanks again!
Click to expand...
Click to collapse
If you want to go down that road, here's the feedback I got when I asked about that 10 days ago:
http://forum.xda-developers.com/showpost.php?p=22706426&postcount=352
In comment 360 there, I write a bit about the amount of source fetched from the net, and how much disk space you would need.
The most problematic part will be setting up your compile host with all the neccessary development packages, which is very dependant on what kind of host system / distribution you use. Google describes it here for an Ubuntu 10.04 install: http://s.android.com/source/initializing.html - which fortunately gave me enough hints to get my openSUSE 11.4 system into working order after half a day of builds aborting in mid-flight...
Your best bet is probably setting up a fresh Ubuntu 10.04 virtual server with approx. 64 GB hard disk and 8 GB RAM, as that is what google appears to use.
Thanks again. That's great info.
I'm testing the first option, which is using busybox the same way you used it.
For me, that involves two steps (loading modules and issuing the mount command).
Here's what I'm doing. I realize I probably don't need to load all these modules, but I'm doing it anyway.
My statically compiled busybox (which you supplied) is in /system/xbin/ and it is executable.
cd /system/xbin/
insmod /system/modules/sunrpc.ko
insmod /system/modules/lockd.ko
insmod /system/modules/nfs.ko
./busybox mount -t nfs 192.168.1.11:/Public /sdcard/nfs/Public
The error is:
mount: Mounting 192.168.1.11:/Public on yigit failed: Protocol not supported
My guess is that the kernel (GLaDOS) which claims to have NFS support may not actually have it (even though it does ship with both nfs.ko and nfsd.ko). Hopefully, I'm wrong on that point and there is a simple mistake I'm making.
For mount commands I have tried all these:
mount -o nolock -t nfs 192.168.1.11:/Public /sdcard/nfs/Public
mount -o vers=3 -t nfs 192.168.1.11:/Public /sdcard/nfs/Public
mount -o prot=17 -t nfs 192.168.1.11:/Public /sdcard/nfs/Public
mount -o prot=6 -t nfs 192.168.1.11:/Public /sdcard/nfs/Public
I had no success with any of them (although the errors were different with some of them). The last two simply report "failed" with no additional detail.
MountainX said:
Here's what I'm doing. I realize I probably don't need to load all these modules, but I'm doing it anyway.
Click to expand...
Click to collapse
Well, I built my kernel nonmodular / have NFS compiled in, as CM9 does not
even have a modules directory + I don't want to hassle with loading modules
before use.
Anyway - to check that after loading the modules, the kernel thinks it has
an nfs client filesystem type, have a look at /proc/filesystems. For NFS v3,
you need an entry reading nodev nfs there.
./busybox mount -t nfs 192.168.1.11:/Public /sdcard/nfs/Public
The error is:
mount: Mounting 192.168.1.11:/Public on yigit failed: Protocol not supported
Click to expand...
Click to collapse
Hmm. Did you check that the NFS server supports the NFS v3 protocol?
Try mounting it using mount -t nfs -o vers=3 ... from your desktop box.
If that does not help - do you have an "strace" program? Then you might try
to run (on device) something like
strace -o /sdcard/mount.nfs.trc /system/xbin/busybox.static mount -t nfs -o vers=3,nolock ...
Click to expand...
Click to collapse
and then e-mail me the /sdcard/mount.nfs.trc file? That will give a hint about
which step in the mounting receives the error.
Would you mind sharing your busybox binary? I got my modules compiled for the kernel and they are loading just fine but the busybox binary I have is missing the nfs functionality as previously mentioned in this thread. And I currently don't have the ressources to build half the android framework.
cyanogenmod NFS mount testing
xywin said:
Would you mind sharing your busybox binary? I got my modules compiled for the kernel and they are loading just fine but the busybox binary I have is missing the nfs functionality as previously mentioned in this thread. And I currently don't have the ressources to build half the android framework.
Click to expand...
Click to collapse
There are now available for testing, several cyanogenmod static busybox
binaries, as well as a CM9 kernel with NFS support.
Visit http://bei.bof.de/droid/mykernel/ for directions and download links.
brian_o'fish said:
There are now available for testing, several cyanogenmod static busybox
binaries, as well as a CM9 kernel with NFS support.
Visit http://bei.bof.de/droid/mykernel/ for directions and download links.
Click to expand...
Click to collapse
Okay I tried your busybox version and it works pretty good. After I realized I forgot to add nfs v3 and v4 support in the module >.>. But yeah it works. The nolock switch is of course mandatory for the mount. Unless you intend to start a portmap daemon.
MountainX said:
Thanks again. That's great info.
I'm testing the first option, which is using busybox the same way you used it.
For me, that involves two steps (loading modules and issuing the mount command).
Here's what I'm doing. I realize I probably don't need to load all these modules, but I'm doing it anyway.
My statically compiled busybox (which you supplied) is in /system/xbin/ and it is executable.
The error is:
mount: Mounting 192.168.1.11:/Public on yigit failed: Protocol not supported
My guess is that the kernel (GLaDOS) which claims to have NFS support may not actually have it (even though it does ship with both nfs.ko and nfsd.ko). Hopefully, I'm wrong on that point and there is a simple mistake I'm making.
Click to expand...
Click to collapse
I got that error in the beginning. As mentioned I forgot to tick the boxes for v3 and v4 support in the nfs module. If you have the kernelconfig you can just add the the functionality and push the kernel modules. No need to flash a new kernel. For NFSv4 support you also need to add auth_rpcgss.ko and rpcsec_gss_krb5.ko in that order before loading nfs.ko
A little speed test:
Procedure: Copying a 1GB file via WLAN (n-Wlan) over both the CIFS and NFS mount. Timed with `time` and using a simple `cp`
Result: CIFS comes in at 1.654MB/s and NFSv3 at 3.219MB/s. So with NFS it's actually possible to watch HD-movies over the network. Finally
CIFSManager:
If you want to use CIFSManager you have to do the following (as root):
Code:
rm /system/bin/mount
ln -sf /system/bin/busybox.static /system/bin/mount
To autoload the modules with CIFSManager open the options and tick every box and change the value of the "Path to cifs.ko" to the following value:
Code:
/system/lib/modules/sunrpc.ko:/system/lib/modules/auth_rpcgss.ko:/system/lib/modules/rpcseg_gss_krb5.ko:/system/lib/modules/lockd.ko:/system/lib/modules/nfs.ko:/system/lib/modules/cifs.ko
Now you can add NFS mounts using the following syntax when creating a new share:
Code:
XXX.XXX.XXX.XXX:/path/to/your/export
Don't forget the colon. In the option parameter for the new mount add "nolock" without the " of course.
Thanks xywin for testing and reporting!
One question though: you talk about NFSv4. I had the impression that my static busybox contains no code at all to do v4 mounting. It tells me "NFSv4 not supported" when trying to force v4 mounts.
Are you sure you have it work with v4?

Tested cifs.ko and nls_utf8.ko (from factory kernel)

Just for interested people, I have compiled cifs.ko and nls_utf8.ko from US version SGHI897 kernel (from samsung opensource website). This package has been tested under JF6, (out-of-box settings, but rooted). Key notes:
0. mount with -o iocharset=utf8, -t cifs
1. use "busybox" to do "mv or cp or mount or umount"
2. use direct "#" prompt to do "insmod"
3. better use GScript after you have tested these ko's
hiway123 said:
Just for interested people, I have compiled cifs.ko and nls_utf8.ko from US version SGHI897 kernel (from samsung opensource website). This package has been tested under JF6, (out-of-box settings, but rooted). Key notes:
0. mount with -o iocharset=utf8, -t cifs
1. use "busybox" to do "mv or cp or mount or umount"
2. use direct "#" prompt to do "insmod"
3. better use GScript after you have tested these ko's
Click to expand...
Click to collapse
I have absolutely no idea what you are talking about, other than it means someone's gonna come up with SOMETHING new to play with here....... =)
techmik67 said:
I have absolutely no idea what you are talking about, other than it means someone's gonna come up with SOMETHING new to play with here....... =)
Click to expand...
Click to collapse
coz, from searching the forum, there is no cifs and utf8 support for captivate. The first is used when using captivate to mount remote windows share folders. In other words, you can use rockplayer on captivate to browser media files on windows desktop. For some reasons, there could be encoding problem to view these media files' names, such as asian characters. Then the second one is needed.
hiway123 said:
coz, from searching the forum, there is no cifs and utf8 support for captivate. The first is used when using captivate to mount remote windows share folders. In other words, you can use rockplayer on captivate to browser media files on windows desktop. For some reasons, there could be encoding problem to view these media files, such as asian characters. Then the second one is needed.
Click to expand...
Click to collapse
I can definitely see why UTF8 is important, though I have no idea what to do with these files to be honest. also, linux-based system that doesn't support UTF8, really?
Kaik541 said:
I can definitely see why UTF8 is important, though I have no idea what to do with these files to be honest. also, linux-based system that doesn't support UTF8, really?
Click to expand...
Click to collapse
Don't quite understand your meaning, sorry. But anyway, just for interested people...
the module works great thanks for your effort.
network pimp... android novice.
hiway123, i pulled down your make of cifs.ko; loaded it in a network folder on my ext sdcard, but am not sure what to do now. (insmod, etc)
I attempted a few mount commands, and a few other linux norm paths, but I think I am lost here. Can you give a 1, 2, step of how to run the mount command? your post was rather cryptic. (i know i know, for the interested only! well definitely interested...)
*Note* I downloaded this nifty app: CIFSmanager app from the market, and it is open enough that it allows for the user to direct path for the cifs module (insmod path) to the file you compiled (again which is now on my sdcard) it seemed to be happy with it, but gave me some other error I believe had something to do with it not being root. (phone is rooted, have several apps with root level access... however haven't yet figured out how to run certain individual apps as root, that don't automatically try to obtain root access. blah blah blah, another project.)
anyhoot - i would love to be able to mount a vfs on this bird! had the captivate for about a month and love'n it! I got tons of media I'd like to stream over the network and found a few nice apps (ARCmedia / rocket, etc.) that i tested (direct copy to sd) and played my .flv files just fine! :-D
now all i need to do it trick the system into thinking my network paths are mounted resources. (Everything else works well, I can access network shares, view pictures, docs, standard video that the default video player can play fine.) So next step is to learn what YOU know.
sorry for the long post! - th x
tucxforever said:
hiway123, i pulled down your make of cifs.ko; loaded it in a network folder on my ext sdcard, but am not sure what to do now. (insmod, etc)
I attempted a few mount commands, and a few other linux norm paths, but I think I am lost here. Can you give a 1, 2, step of how to run the mount command? your post was rather cryptic. (i know i know, for the interested only! well definitely interested...)
*Note* I downloaded this nifty app: CIFSmanager app from the market, and it is open enough that it allows for the user to direct path for the cifs module (insmod path) to the file you compiled (again which is now on my sdcard) it seemed to be happy with it, but gave me some other error I believe had something to do with it not being root. (phone is rooted, have several apps with root level access... however haven't yet figured out how to run certain individual apps as root, that don't automatically try to obtain root access. blah blah blah, another project.)
anyhoot - i would love to be able to mount a vfs on this bird! had the captivate for about a month and love'n it! I got tons of media I'd like to stream over the network and found a few nice apps (ARCmedia / rocket, etc.) that i tested (direct copy to sd) and played my .flv files just fine! :-D
now all i need to do it trick the system into thinking my network paths are mounted resources. (Everything else works well, I can access network shares, view pictures, docs, standard video that the default video player can play fine.) So next step is to learn what YOU know.
sorry for the long post! - th x
Click to expand...
Click to collapse
I have a samba server in LAN, say at 192.168.1.1. So, I do these steps:
1. unzip my package to your computer, there are two ko files. Then use USB cable to transfer these two files to your phone in /sdcard folder.
2. on the phone, I used "terminal emulator", run "su" into root mode, make new folders like "busybox mkdir /system/lib/modules", you may try other directory name, I don't think that does a matter. Move the two ko files from /sdcard to this newly created folder, remember to use "busybox mv" command.
3. create a mount point on your phone, "mkdir /sdcard/smb" for example. or "busybox mkdir" I cannot remember.
4. insert modules, using "insmod /system/lib/modules/cifs.ko" and "insmod /system/lib/modules/nls_utf8.ko", remember these commands must be run everytime after you reboot your phone, so I use Gscript to create a shortcut, it's very convenient.
5. mount server's samba share folder in the phone, using "busybox mount -t cifs //192.168.1.1/your_share_folder /sdcard/smb -v -o user=yourusername,pass=yourpasswd,iocharset=utf8".
6. now, you can use rockplayer to browse into /sdcard/smb on your phone to view what is shared.
7. It is better to umount your folder once you finish transferring files. Then simply do "busybox umount /sdcard/smb".
Actually, only commands 5-7 are needed after your first attempt. Of course, if you have not done step 4 after a reboot, you need to do that step as well. I use Gscript in market to create shortcuts to these 4-7 commands. That's more convenient instead of typing on such small screen.
Have you tried this with any of the Custom ROMs in this section? If so, which ones work? Can you tell me how to compile a CIFS.KO?
Can it be compiled against the ROMs supplied here?
Thanks in advance,
Freaking brilliant, was exactly what I was looking for...thanks OP!
*edit*
Should mention, I used the posted .KO with stock rogers rom (i896) and it seems to be working flawlessly from my testing so far. I've even been able to stream some lower bitrate HD video and have it run smoothly and consistantly
insmod: init_module '/system/lib/modules/cifs.ko' failed (Exec format error)
something wrong?
i use SetiroN's kernel... and I9000 Froyo - maybe that is the reason?
Id assume that the kernel you are using isn't compatible and the module will have to be compiled for it.
Sent from my SAMSUNG-SGH-I896
love the rom just wish had few diff tweaks

[SOLVED] CIFS support

A noob question support. Is there a CIFS support in the 2.6.32.21-gbe90714 kernel or a suitalbe cifs.ko file that one could use with the Cifsmanager app?
I am a bit lost here. I downloaded the DHD kernel source released, but had no luck locating the cifs.ko file. And I have no idea how to compile one myself. Can someone pinpoint me in the right direction?
update:
found some instructions here http://forum.xda-developers.com/showthread.php?t=783117 so I will see if I can get it working
update 2:
i have been able to build cifs.o (no cifs.ko was produced ) from the kernel provided by HTC, but it fails with insmod. The problem might be (besides that I have only a vague idea what am I doing) that the downloaded kernel is 2.6.32-g5ed1769 and my phone is running kernel 2.6.32-gbe90714.
Also compiling the kernel ends with this error
make[3]: *** No rule to make target `drivers/input/touchscreen/ntrig.o', needed by `drivers/input/touchscreen/built-in.o'. Stop.
Thats where I got stuck.
I have attached the file cifs.o produced.
Updare 3: Solved - see attachment in post http://forum.xda-developers.com/showthread.php?p=8865419#post8865419
Support/Troubleshooting forum sub section is needed, this Desire HD general is becoming a Desire HD trashcan..
M_T_M said:
Moved to general. Not a DEV thread.
Cheers,
Click to expand...
Click to collapse
I placed in DEV since it deals with kernel compilation. Maybe it should be moved to theme and apps as I am trying to get Cifsmanager app working on DHD.
Small update: I have managed to get a cifs.ko from kernel 2.6.32.17 from G2 partially working. I have HEX edited the file and changed to my kernel version.
I can insmod the file and mount drive without a problem. I can than access the mounted drives a browse the folders, but when I try to open the file I get an error.
I do not seem to be able to find a 2.6.32.21 kernel compiled cifs.ko which I believe might work with HEX updating "-gbe90714".
*push*
looking for the right cifs.ko as well :\ would be really nice to be able to mount cifs shares without custom rom...
anyone got CIFS working on stock ROM?
CIFS working on 2.6.32.21-gf3f553d
here is a working cifs.ko for DHD kernel 2.6.32.21-gf3f553d
Code:
su
insmod slow-work.ko
insmod cifs.ko
insmod nls_utf8.ko
It's a hex edited and --strip-debug cifs to educe file size of the version from MikeMelbourne. http://forum.xda-developers.com/showpost.php?p=9780217&postcount=7
Works fine on my DHD (samba access and video playback with V Player).
nxtwrld said:
here is a working cifs.ko for DHD kernel 2.6.32.21-gf3f553d
Code:
su
insmod slow-work.ko
insmod cifs.ko
insmod nls_utf8.ko
It's a hex edited and --strip-debug cifs to educe file size of the version from MikeMelbourne. http://forum.xda-developers.com/showpost.php?p=9780217&postcount=7
Works fine on my DHD (samba access and video playback with V Player).
Click to expand...
Click to collapse
Thanks for this, it works fine when I insmodded all the .ko's you zipped (that I placed in system/lib/modules/). On reboot though I cannot use cifs manager unless I insmod again. Do I need to insmod everytime i reboot?
Sent from my Desire HD
nxtwrld said:
It's a hex edited and --strip-debug cifs to educe file size of the version from MikeMelbourne. http://forum.xda-developers.com/showpost.php?p=9780217&postcount=7
Click to expand...
Click to collapse
I understand the hex edit - would you mind telling me how you did the --strip-debug - I'd like to do the same.
They were compiled on a headless PII 400 MHz running Ubuntu Edgy Eft server.
-Mike-
You just need to have the android ndk, which I supposed you have since you have bee able to compile the kernel. So just run
Code:
/path/to/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-strip --strip-debug /path/to/cifs.ko
you have to modify the path to cifs.ko a and android-ndk-r4b
I have bee trying to compile the kernel my self on kubuntu, but always finished with an error, so I just ended up hexediting other files.
Thanks for your files. I have been waiting for a working samba mount to stream my videos from NAS!!
keemyb said:
Thanks for this, it works fine when I insmodded all the .ko's you zipped (that I placed in system/lib/modules/). On reboot though I cannot use cifs manager unless I insmod again. Do I need to insmod everytime i reboot?
Sent from my Desire HD
Click to expand...
Click to collapse
I am afraid it has to be insmoded every time on boot. You can automate it with Gscript or Tasker apps.
Thanks @Nxtwrld for the strip-debug advice. The HTC kernel never compiled with my phone's config.gz - after each failed compile I would have to edit .config and disable the item responsible for the build failure. I ended up compiling the module by itself.
Sent from my Desire HD using XDA App
Final compile - optimised versions against NDK R5.
Against the new Android NDK R5 I have just compiled:
* tun.ko - 18 KB
* slow-work.ko - 16 KB
* cifs.ko - 269 KB
* nls_utf8.ko - 4 KB
I have also debug stripped them - resulting in a total module size of 304 KB instead of 3.2 MB.
This time I compiled them on Ubuntu 10.10 instead of the ancient Ubuntu 6.10 I had been compiling on.
Again, these are for 2.6.32.21-g66cfb7a - feel free to hex edit them. I have tested both tun & cifs and they work.
Thanks again nxtwrld for the strip-debug advice.
Can you do the same for kernel 2.6.32.21-g3d0aaf ?
here you go.
thank you! Works very good!
nxtwrld said:
here you go.
Click to expand...
Click to collapse
Sent from my Desire HD using XDA App
I've tried for hours so far to understand more about the android and how to install the files inside 2.6.32.21-gf3f553d.zip.
I have the Desire HD with stock Orange rom and that kernel, i literaly have no idea how to install thease moduals onto the phone.
My desire hd is rooted and is S-on I've tried things like Kernel Update Utility and also just trying to simply copy and paste the files into system/lib/modules didnt work since astro didnt let me paste.
If it wasnt nearly 1am and i wasn't trying for the past 3 hours i would have done more reading. I know its something simple im missing, just can't figure out what the process is to installing thease modules is. First Android phone, first day with it as you can probebly tell.
Any help will be apreciated.
Thanks
arielc said:
I've tried for hours so far to understand more about the android and how to install the files inside 2.6.32.21-gf3f553d.zip.
I have the Desire HD with stock Orange rom and that kernel, i literaly have no idea how to install thease moduals onto the phone.
My desire hd is rooted and is S-on I've tried things like Kernel Update Utility and also just trying to simply copy and paste the files into system/lib/modules didnt work since astro didnt let me paste.
Click to expand...
Click to collapse
There's a free app in the market called "mount /system (rw / ro)" that can make your /system read-write (rw) or read-only (ro). After setting rw - you should be able to copy the *.ko files into /system/lib/modules.
Another alternative is to copy the *.ko files onto your sdcard (/mnt/sdcard).
You can then use an app (i.e. "Terminal Emulator") to enter these commands:
Code:
su
insmod /mnt/sdcard/slow-work.ko
insmod /mnt/sdcard/cifs.ko
insmod /mnt/sdcard/nls_utf8.ko
Alternatively, you can open CifsManager, open the Settings and specify a custom path to your kernel modules (i.e. in /mnt/sdcard). The recent version allows you to specify multiple modules, separated by colons. e.g:
Code:
/mnt/sdcard/slow-work.ko:/mnt/sdcard/cifs.ko:/mnt/sdcard/nls_utf8.ko
Hope this helps.
You should also check you kernel version and verify, that you are really running pin this kernel. I have no idea what the kernel for Orange branding is....
Amazing thanks, i did it with the terminal emulator method. First time i tried it, it wouldnt work. A restart later and i've rentered the comands and my computer drive is mounted. Works like a dream, thanks loads for th hex edited files and the walkthrough with diffrent options was so very helpful.

[How to] CIFS after 4.1.83 update

Anybody who wants to get CIFS working after 1.8.3 update (assumes you have cifs.ko and slow-work.ko from 1.5.7)
1) adb
2) su
3) mkdir /lib/modules/2.6.32.9-00007-g527fe10
4) cp <slow-work.ko location>/slow-work.ko /lib/modules/2.6.32.9-00007-g527fe10
5) cp <cifs.ko location>/cifs.ko /lib/modules/2.6.32.9-00007-g527fe10
6) depmod -a
7) modprobe slow-work.ko
8) modprobe cifs.ko
9) reboot
This will load up CIFS automatically after every boot.
-F
I will move this to development when you reach the posts limit so you can have the chance to discuss overthere.
Thanks,
Can you upload these two files
I don't have them from 1.5.7
Thanks much,
Foogl said:
Anybody who wants to get CIFS working after 1.8.3 update (assumes you have cifs.ko and slow-work.ko from 1.5.7)
1) adb
2) su
3) mkdir /lib/modules/2.6.32.9-00007-g527fe10
4) cp <slow-work.ko location>/slow-work.ko /lib/modules/2.6.32.9-00007-g527fe10
5) cp <cifs.ko location>/cifs.ko /lib/modules/2.6.32.9-00007-g527fe10
6) depmod -a
7) modprobe slow-work.ko
8) modprobe cifs.ko
9) reboot
This will load up CIFS automatically after every boot.
-F
Click to expand...
Click to collapse
Anybody who wants to get CIFS working after 1.8.3 update (assumes you have cifs.ko and slow-work.ko from 1.5.7)
Click to expand...
Click to collapse
Can you explain how to get CIFS if we don't have cifs.ko and slow-work.ko from 1.57? Not new to linux, but new to working with android so step-by-steps are apprecaited.
Thanks
ibscum said:
Can you explain how to get CIFS if we don't have cifs.ko and slow-work.ko from 1.57? Not new to linux, but new to working with android so step-by-steps are apprecaited.
Thanks
Click to expand...
Click to collapse
Well, you can build them from the source. But here are some useful ko's build for 1.57
Sorry for the noon question but what is cifs
Sent from my MB860 using XDA Premium App
CIFS ...
... is a network protocol for sharing various thinks (files, printers, ...).
See http://en.wikipedia.org/wiki/Server_Message_Block
You are using in Windows to share folders on network. Linux implementation is called Samba. If you have that capability on your phone, you can mount your home network shares, watch movies directly from your phone without actually copying them on the phone and all sort of good thinks.
It is absolutely essential service, if you want to use your phone more extensively.
Do you know how to get nls_utf8.ko working with cifs?
Insmod nls_utf8.ko says "error inserting 'nls_utf8.ko': -1 Invalid module format
Foogl said:
... is a network protocol for sharing various thinks
Click to expand...
Click to collapse
Grr, hopefully this doesn't cause a double post - having user error even getting a quick reply in...
I followed your directions above but had some issues. When copying the files over, I kept getting 'cannot stat ..." I gave it the full path, it was under the c directory, I even tried placing the files directly under C but no matter what it kept giving the same issue. I then just copied them onto the phone using mass storage method and then did a cp from adb shell to put them in the modules directory. I assume it needed to be copied using the shell as su in order for permissions to work out?
Then I did depmod -a, which worked fine. However, modprobe .. did not. It only retuns FATAL cannot find module etc. I tried giving it the full path to the files with no success. So a google search showed some people saying to try insmod instead. I treid that giving the full path to the files and it didn't return any errors. So I ASSUME it worked?
Not sure why this didn't go as smooth as your instructions. I feel like I hacked my way through it and it's likely gone awry. I wont be able to test this out with CIFS manager until later tonight. Any suggestions on where I went wrong or what I might need to redo?
Thanks!
Well, it worked like a champ. Thanks for the quick how-to and help. Now if I could find an app that will play .iso format movies it would all be perfect...
Update:
Not only does it work, it works great. Had some time to really play with it and I couldn't be happier. No more streaming from PC to phone (except for iso formats) via apps like VLC S&C. Simply browse to the mount which looks just like any other folder on my phone and open and play my media, or open my docs. Quality is excellent, can seek/skip whatever without any hesitation. In short, it acts just as though it's a local folder. I know this is old news to most of you. Just thought I'd share for those who aren't familiar with CIFS. I swear, this connects/mounts to my windows server and plays better than my windows PC.
Just to clarify, for those who my run into the same issues I did.
If it refuses to copy the files from your pc to phone under adb shell, just copy them to your phone via the usual usb mass storage drag/drop method. I placed them in a temp folder. then back to the adb shell, do the cp commands just adjust the path where the files live to the path on your phone (i.e. in the temp dir). I suppose you might be able to just move these into the modules dir using a file explorer w/ root privs but I wanted to be sure the correct file permissions existed by doing it with adb shell as su.
Then if, after doing depmod -a the modprobe doesn't work, use insmod. I gave the full path to where you copy these files in (/lib/modules/2.6.32.9-00007-g527fe10/<filename>). Again, not sure if thats needed or if it's smart enough to scan the full modules hierarchy for the file names.
This doesn't seem to work for me anymore after the GB OTA update. Anyone has it working for them?
norm688 said:
This doesn't seem to work for me anymore after the GB OTA update. Anyone has it working for them?
Click to expand...
Click to collapse
Me either..
Cifs.ko for 4.5.91 would be awesome.
Me either..
Cifs.ko for 4.5.91 would be awesome.
Click to expand...
Click to collapse
Agreed! Any help on getting Cifs running would be greatly appreciated.
Been searching for something and found this:
http://forum.xda-developers.com/showthread.php?t=1113191
Is there any harm in using a cifs.ko intended for a different device? I'm at work now, but might give this a shot when I get home to see if it's functional for Atrix. There's another thread under the development section asking the same question of where we can get a Gingerbread friendly module.
Any direction is appreciated.
theres a bunch of kernels (some included in ROMs) with baked in CIFs support such as the popular faux123's overclock/undervolt kernel.
Flash a kernel via clockwork, no muss no fuss.
theres a bunch of kernels (some included in ROMs) with baked in CIFs support such as the popular faux123's overclock/undervolt kernel.
Flash a kernel via clockwork, no muss no fuss.
Click to expand...
Click to collapse
Hmm. Haven't taken the leap to unlock the BL. Haven't had a need for a custom ROM yet. Really, the only functionality missing for my purposes is this cifs module. I'd rather not have to unlock and bake a custom ROM just for a cifs module if possible.
fair enough. I figure if I'm rooting around system files (pun intended) might as well go the whole hog.
Then again I've run custom ROMs on all 3 droids I've owned so I'm kinda used to the assumption that whatever stock is, I can get it much faster/better
ibscum said:
Is there any harm in using a cifs.ko intended for a different device?
Any direction is appreciated.
Click to expand...
Click to collapse
There shouldn't be... but I'm pretty sure the Module (cifs.ko) needs to be compiled for the specific kernel version. (2.6.32.9-00001-g41bc3e0 [email protected] #2) The Actual Android version (GB 2.3.4) does not matter.
So if you find a cifs.ko for THAT kernel version (or a Kernel thats close enough) it might work. It's trial and error.
There are lots of folks (far smarter than I am), who can grab the kernel source and compile a cifs.ko... I'll have to learn one of these days.
fair enough. I figure if I'm rooting around system files (pun intended) might as well go the whole hog.
Click to expand...
Click to collapse
True. I have the official OTA 2.3.4 update and haven't seen any clear direction on whether I can unlock - looks like most of the information is related to those who unlocked with the leaked update. Granted, I haven't put much time into it since I've been content up until now. Might be time to start digging for info.
So if you find a cifs.ko for THAT kernel version (or a Kernel thats close enough) it might work. It's trial and error.
There are lots of folks (far smarter than I am), who can grab the kernel source and compile a cifs.ko... I'll have to learn one of these days.
Click to expand...
Click to collapse
I believe the module I linked was from a Samsung device so I'm guessing it's a no go. Appreciate the info guys!
wintermute000 said:
theres a bunch of kernels (some included in ROMs) with baked in CIFs support such as the popular faux123's overclock/undervolt kernel.
Flash a kernel via clockwork, no muss no fuss.
Click to expand...
Click to collapse
Took this advice and flashed faux123's kernel.
Not only does cifs work... my data speeds went from 300k average.. to 2mb average.
Thanks for the advice

[Q] Error mounting CIFS shares on N4 CM10.1

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?

Categories

Resources