Allows to mount a samba (windows) share, so you can e.g. play avi movies over wi-fi directly from a remote shared folder using e.g. RockPlayer.
Unlike the samba support in the ES Explorer, no downloading to a temp file on the SD card takes place and there's no waiting for the download to finish before the playback begins. When using this kernel module, from the applications' point of view, there's no difference between the network files and the local files on the SD card.
Usage:
Code:
mount -t cifs //<ip>/<share> /<mount point> -o username=<user>,password=<password>
Example: tested on CyanogenMod-6
Code:
insmod /system/lib/modules/2.6.34-cyanogenmod/kernel/fs/cifs/cifs.ko
busybox mount -t cifs //192.168.1.3/avi /sdcard/samba -o username=guest
Example: tested on CyanogenMod-6 with wildmonks kernel
Code:
insmod /system/lib/modules/2.6.35/kernel/fs/cifs/cifs.ko
busybox mount -t cifs //192.168.1.3/avi /sdcard/samba -o username=guest
then watch some movies... and later unmount it to save the battery:
Code:
busybox umount /sdcard/samba
I recommend to use the GScript application for the mount and umount scripts, then you can put them as GScript shortcuts somewhere on your screen...
For multi-language support use wildmonks latest kernel kernels dated 072410 that has unicode support.
(Recommend using this one for first time users 2.6.35-rc6_AVS-925mV_CFS_1113Mhz_072410.zip)
Example:
Code:
insmod /system/lib/modules/2.6.35/kernel/fs/cifs/cifs.ko
busybox mount -t cifs //192.168.1.3/avi /sdcard/samba -o username=guest,iocharset=utf8
I tested this and I can see the Cyrillic alphabet just fine.
Very cool! So in theory, I should be able to mount my music shares on my network and stream those while at home? Since we're talking about the kernel, perhaps the default music player might work?
There's no difference between the network files and the local files on the SD card.
Well, right, when you posted that that's what got me thinking about the music. So... I'm right? Well, I will try it later on tonight.
Does this have to be built into the kernel?
Set the path to an existing file cifs.ko. Just search the system using the Root Explorer (File Manager)
How do I show unicode filenames when mount?
I tried -o iocharset=utf8, but it requires nls_utf8.ko, which I don't know where can I get this library
Amazing! Works great on my Nexus One
This is a pretty nice and simple method to get media access over the network. Thanks for sharing this great tip!
@J.L.C.
Most if not all kernels have this either built in or compiled as a module.
Works great! Thx a lot! But how can I add russian language support? I meen when I mount source folder, the folders in russian shown with ??????? and I can`t enter to them.
d750 said:
Allows to mount a samba (windows) share, so you can e.g. play avi movies over wi-fi directly from a remote shared folder using e.g. RockPlayer.
Unlike the samba support in the ES Explorer, no downloading to a temp file on the SD card takes place and there's no waiting for the download to finish before the playback begins. When using this kernel module, from the applications' point of view, there's no difference between the network files and the local files on the SD card.
Usage:
Code:
mount -t cifs //<ip>/<share> /<mount point> -o username=<user>,password=<password>
Example: tested on CyanogenMod-6-RC1
Code:
insmod /system/lib/modules/2.6.34-cyanogenmod/kernel/fs/cifs/cifs.ko
busybox mount -t cifs //192.168.1.3/avi /sdcard/samba -o username=guest
Example: tested on CyanogenMod-6-RC1 with wildmonks kernel
Code:
insmod /system/lib/modules/2.6.35/kernel/fs/cifs/cifs.ko
busybox mount -t cifs //192.168.1.3/avi /sdcard/samba -o username=guest
then watch some movies... and later unmount it to save the battery:
Code:
busybox umount /sdcard/samba
I recommend to use the GScript application for the mount and umount scripts, then you can put them as GScript shortcuts somewhere on your screen...
Click to expand...
Click to collapse
I just wanted to say, i was referred to this thread from another topic i posted, basically inquiring about an app, that would do exactly this.
I already had shared folders setup on my computer (and know how to see what they are REALLY called, how samba sees them) for streaming to my Wii, so with the instructions above, this was REALLY easy.
My setup is in my sig, and i basically just copy/pasted the first example (substituting my ISP and shared directory name), and it worked, without flaw...
I would like to simply say, Thank you.
would love to see this as an actual app with a gui! any takers?
Thanks heaps man
I initially had tried getting this to work with my phone after the release of Rock Player, I was trying to run cifs.ko directly without the pathname and eventually gave up and placebo streamed via ftp (dumping file to sdcard while playing it)
Thanks again!!!
Wow! I've been looking for this feature for a last week.
Is there any chance to get it working on stock FRF91?
When I try it gives me "no such device" stderr
Aquila said:
Wow! I've been looking for this feature for a last week.
Is there any chance to get it working on stock FRF91?
When I try it gives me "no such device" stderr
Click to expand...
Click to collapse
Same happens here...
And that would be afeature I would love to have working...
Simpson84 said:
Works great! Thx a lot! But how can I add russian language support? I meen when I mount source folder, the folders in russian shown with ??????? and I can`t enter to them.
Click to expand...
Click to collapse
subscribe to the issue of displaying Cyrillic
how fix it?
sorry for my English
AllanJacques said:
Same happens here...
And that would be afeature I would love to have working...
Click to expand...
Click to collapse
I've just upgraded to the recent Cyanogen 6.0-RC2 and it works like a charm.
I am using the second command (just set up a proper path to cifs.ko).
Amazing ! Thanks a lot ! Just lots of thanks Great !
dimon1983 said:
subscribe to the issue of displaying Cyrillic
how fix it?
sorry for my English
Click to expand...
Click to collapse
I afraid the only fix is to rename your folders and files to be using Latin characters.
Update: it works but unmount is not found.
applet not found
please help to unmount this all
please help me making it work at all...
My notebook is on the same wireless network than my N1, my second hd is named Swap, I want to share the whole hd with N1 and when doing this:
insmod /system/lib/modules/2.6.34-cyanogenmod/kernel/fs/cifs/cifs.ko
busybox mount -t cifs //192.168.2.3/swap /sdcard/samba -o
username=myusername,password=mypassword
it doesnt work, and using guest as username gives me no device found!
Please, help me?
Hi,
I was playing around with some kernel files and saw that cifs was mentioned.
So I tried to mount my NAS share and it worked I have stock samsung 2.2 firmware.
You don't need a rooted phone.
Use adb:
- adb shell
- mkdir /sdcard/nasmount
mount -o username=[your username],password=[your password] -t cifs //10.0.0.200/shared /sdcard/nasmount
Your NAS/PC has different ip and share name. Same as for username and password.
Now you can play music, pictures or movies directly from your NAS.
If your nas is not connected after the mount there will be a delay when browsing the sdcard.
Use umount /sdcard/nasmount command to unmount.
Cheers
ps: cifs manager also works fine now. It default mounts on /mnt/cifs
Wanted to update this should anyone run across it - selinux is the issue...
Hi, I would like to know why I can see but not read files in NFS mounts unless they are in the primary storage location(internal storage - /data/media/0) and viewed from an app not running elevated privileges. (problem is if you have the mountpoint at a location you can only access with a file explorer running as root, you can see the files but not read them, and if you aren't root of course you can't get to the mountpoint). You can only read the files when running as a regular user which seems counter-intuitive to my understanding of the basic linux principal of root. This has only started recently, I am guessing android 4.2+
I am able to mount and read off NFS shares with stock kernel on CM10.2 (GS3), but it is a hassle because I have to switch my file explorers from root access to nonroot all the time.
the relevant line for my mounted share example from /etc/exports from server at local ip address 192.168.1.117:
Code:
/home/myth/myth1 192.168.1.0/24(rw,insecure,no_subtree_check,async)
I use smanage app (script manager) (and for some reason script must be run off of /storage/sdcard1 -- external sdcard, not internal memory) and flag it as "su"(root) and "boot"(makes it run at boot).
I have it set up so that I create the folders at boot, then either mount or unmount the network share with 3 different scripts that I can create widgets for on my home screen, but basic language should be same (note change "myth/myth1" to whatever folder names you have, and you only need the primary folder not a secondary, i just set it up this way because I have multiple mounts)
directory creation language:
Code:
mkdir /data/media/0/myth
mkdir /data/media/0/myth/myth1
mount language:
Code:
busybox mount -t nfs 192.168.1.117:/home/myth/myth1 /data/media/0/myth/myth1 -o nolock,rsize=8192,wsize=8192
language to unmount:
Code:
umount /data/media/0/myth/myth1
Now some important things:
1- This server setup (etc/exports) worked fine and had no issues before android 4.2
2- I have had severe issues trying to mount at other points other than /data/media/0, so I can not recommend mounting anywhere else, though it may be possible
3- Starting with Android 4.2, there are major issues seeing things such as NFS mounts among different applications. For some reason I can see, but NOT READ files on the NFS share when the file explore app is running as ROOT/SU. This is why I have only recently been able to get it to work at /data/media/0, and that is because I figured out that the mountpoint has to be accessible by an app when it is not running root privileges. People have hinted that this has something to do with the new multiuser namespaces : see the bottom of this page: http://source.android.com/devices/tech/storage/index.html
any thoughts or understandings would be greatly appreciated on this so I can keep my NFS shares working with further changes
Hi all,
So I've spent hours trying to solve this, using everything I have found on the Internet. (This problem isn't exclusive to CIFS mounts by the way, it's all FS types. CIFS mount is what I require)
Basically I have an android box that's running 4.4.2. I need to mount a NAS box onto the file system. I can do this no problem using Terminal as SU. As soon as I use another App to navigate to the location, the mounted location isn't visible. I know that it is a known bug/security restriction after 4.2, and is due to multiusers or something. People have suggested including the mount command into /system/bin/debuggerd because the start command is a system command that has higher privileges or something. Anyway, I've tried this by just removing the contents of debuggerd and typing the following:
#!/bin/sh
mount -o username=JOELB,password=password -t cifs //192.168.1.252/PUBLIC /data/media/0/NAS
However, this doesn't work on boot, or if i run 'start debuggerd'
Apparently /data/media/0 is the location I should be mounting to, due to the bug/security flaw. Apps like mount manager are useless because they only work for that app.
Can anyone help me on this... It's killing me!!
Many thanks
Joel
I searched enough forum posts on XDA and elsewhere that resulted in <null> that i was ASTOUNDED when I FINALLY got this to work.
My goal was to, while remote and connected to home via VPN, to use my phone to browse to and download a file directly onto my NAS. Downloading it locally (ie, onto the phone), then copying/moving it to my NAS via ES File Explorer was a pain in the rear, and just not good enough for me in today's fast-paced no-patience world. Plus, too many posts I read ended in "it can't be done" so my stubborn butt would not give up
SOOOoooo... here it is:
To mount a CIFS/SMB share from a remote network to a local directory on your device:
1 - Prerequisites:
- root
- francokernel
- busybox (pro?)
- ES File Explorer with root access
2 - /etc/fstab:
- I found a file on github that I can't link because I've been leaching off of XDA for years and haven't contributed enough to post links.
- Google the phrase "nexus 6p fstab", for me the github page with the fstab file is the first search result
- I saved that file on my phone as (*gasp*) /etc/fstab
3 - create local path:
- I chose to create /data/media/0/my_local_path because (A) /data exists in the fstab file, and (B) /data/media/0 seems to me to be the source of or a symlink to /sdcard (*and/or*?) /storage/emulated/0 (not sure to be honest, haven't researched this yet)
Edit: I still haven't researched why, but the path I created in /data/media/0/ did not survive a reboot. I instead made /data/my_path and so far this is sticking around.
4 - setup download directory:
- since I don't use ES Downloader for any other purpose, I chose it as my download-to-NAS app.
- I set the default download directory for ES Downloader to /data/media/0/my_local_path
5 - mount command:
- in a command prompt on my desktop machine with the phone connected via USB:
Code:
adb shell
angler:/ $ su
angler:/ # setenforce Permissive
angler:/ # exit
angler:/ $ su --mount-master -c busybox mount -o username=myshareaccessusername,password=myshareaccesspassword,rw,noperm,file_mode=0777,dir_mode=0777,iocharset=utf8 -t cifs //xxx.xxx.xxx.xxx/path/to/my/share /data/media/0/my_local_path
angler:/ $ su
angler:/ # setenforce Enforcing
Edit: This worked the first time, but after a reboot is got "sh: busybox: not found". Did some research, still not sure why I had to replace "busybox" with "/sbin/busybox" in the mount command, but that did work.
That's it!!!
I am NOT connected to my local network or USB to my computer. I go to the Googles and find some random file to download, download it with ES Downloader, and VOILA!!! it is in my chosen directory on my NAS at home. Works when I am remote and connected to my home via VPN.
Badda bing badda boom!
And you're all thinking it, I'm just confirming it... yes, I am somewhat of a noob and very proud of myself. So what???
~PEACE