How can I mount a NFS share? - Networking

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?

Related

Debian working niceley on Desire.

Debian for Desire.
If you are able to try this on another android device, please do as I will be very interested in the results.
Download
http://www.multiupload.com/79TSI1AAF9
You will need.
-Root access.
-Busybox (included in most custom roms)
-1.4gig free on SDCARD
-VNC Client (ie. AndroidVNC)
-Terminal Emulator (ie. ConnectBot)
-7zip
Instructions
-Extract the file deSIREbian.7z on your PC using 7zip.
-Copy the contents (debian.img and deboot) to root directory of SDCARD.
-On your phone in terminal emulator type
su
sh /sdcard/deboot
Click to expand...
Click to collapse
You should get a blank screen showing "localhost:/#" after a couple of seconds.
-On your phone in your VNC client log in using these details
Password - password
Port - 5901
Click to expand...
Click to collapse
Nickname and Address are not needed, call it what you want though.
Changing the colour to 24bit and enabling local mouse pointer and full screen bit map are not neccesary but reccomended.
-Thats it.
Notes.
-You can log in via ssh, (gives a much better terminal, ie works properly with aptitude). Use [email protected] and password "toor"
-The version of Debian is Armel Lenny, installed using debootstrap.
-It is just the base package with LXDE on top, you only get a desktop, a file browser, an internet browser, and a pic viewer.
-If you want more packages there's tonnes of room on the image. eg apt-get install openoffice.org or apt-get install abiword or apt-get install any flipping thing u want
-You can access the SDCARD from Debian at "root/sdcard" (read-write)
-You can access Debian filesystem from Android (When Debian is running) at "sdcard/debian" (read only)
-debian.img is mounted at "sdcard/debian" using "dev/block/loop5"
-So far the only rom i have come accross that this dont work with is one of the cyanogen nightlies from last week. apart from that, working on opendesire, cyanogen, defrost, leedroid, official 2.2 with busybox...
Issues.
Debian cannot be shut down. You need to reboot the phone to do this. (You can kill the VNC server with "vncserver -kill :1" there is an icon on the festoons to do this.)
Update log.
deSIREbain.
-First release.
deSIREbain2
Fixed
-Loading a second terminal no longer breaks vnc.
-You no longer need to create the folder debian on sdcard.
Added
-ssh server (login with root and toor)
Removed.
-The image has been downsized from 2 gig to 1.4
Hey,
thank you for your work, i will test it so far and will tell you the results
got this error:
Code:
# su
su
# sh /sdcard/deboot
sh /sdcard/deboot
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: mounting /sdcard on /sdcard/debian/root/sdcard failed: No such file or di
rectory
net.ipv4.ip_forward = 1
chroot: can't change root directory to /sdcard/debian: No such file or directory
#
If you have the same problems try out
su
mkdir /sdcard/debian
losetup /dev/block/loop3 /sdcard/debian.img
mount -t ext2 /dev/block/loop3 /sdcard/debian
ls /sdcard/debian
thx to mercianary for help
greetings
I found this guide quite helpful at getting a bootstrapped Debian setup running.
http://www.saurik.com/id/10
I didn't need to insert the ext2 module as it's already loaded for me, I guess G1s didn't have that convenience back then.
blackstoneuser5 said:
I found this guide quite helpful at getting a bootstrapped Debian setup running.
www . saurik.com/id/10
I didn't need to insert the ext2 module as it's already loaded for me, I guess G1s didn't have that convenience back then.
Click to expand...
Click to collapse
I used parts of this for reference too. Its a great guide, explains things really well.
i've just updated this. link is in the first post.
Fixed
-Loading a second terminal no longer breaks vnc.
-You no longer need to create the folder debian on sdcard.
Added
-ssh server (login with root and toor)
Removed.
-The image has been downsized from 2 gig to 1.4
debian for desire--help please
hi
I spent much time for searching debian or ubuntu for desire, but nothin worked
know i found this and i have download everything and start to install over the terminal
but the " sh /sdcard/deboot" is not workin to
there's only this answer:
# su
su
# sh /sdcard/deboot
sh /sdcard/deboot
[: not found
losetup: not found
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
busybox: not found
sysctl: not found
chroot: not found
may somebody help me?
i really want to have it on the desire
thanks
It looks like you had not installed busybox
Which ROM do you use ?
oh i'm sorry
i'm a newbie and don't really know what a rom is
but i had problems with busybox and there was a somebody who said i can get the app titanium and let it install the busybox
could you please show me a tut how to install busybox
maybe a german tut
thanks
Getting error at: sh /sdcard/deboot
line 5: syntax error near unexpected token `else'
Rosi1337 said:
Getting error at: sh /sdcard/deboot
line 5: syntax error near unexpected token `else'
Click to expand...
Click to collapse
dont know why that happened.. works on mine. syntax looks ok to me.
try with this one (attatched), it's the same but without the bit that's not working for you.
what rom are you using, i shall try to replicate the error so I can try to fix properly.
thepuechen said:
could you please show me a tut how to install busybox
maybe a german tut
thanks
Click to expand...
Click to collapse
There should be a guide on installing busybox somewhere if you want to search for it, i know i remember seeing one a while ago.
Too be honest, your better off just flashing a rom that includes busybox, it would be MUCH easier.
have a look here and see what takes your fancy, I would recomend defrost, because it is stable and easy to overclock.
Thanks mercianary,
It works fine!,
I use customised DeFroST_0.9b_uvonly with USB-host patch.
By the way I would like to add more options to kernel line.
Where can I find like a menu.lst file ? or How to add it to kernel line.
There is no /dev/graphics/* in running Debian console.
I would like to use FrameBuffer on running Debian.
thanks,
Android VNC won't connect Trying to get a handshake, but then says that VNC connection failed
please paste at that time log
jacobtc said:
Android VNC won't connect Trying to get a handshake, but then says that VNC connection failed
Click to expand...
Click to collapse
Please paste at that time log.
Maybe vnc server does not running.
tknv said:
Thanks mercianary,
It works fine!,
I use customised DeFroST_0.9b_uvonly with USB-host patch.
By the way I would like to add more options to kernel line.
Where can I find like a menu.lst file ? or How to add it to kernel line.
There is no /dev/graphics/* in running Debian console.
I would like to use FrameBuffer on running Debian.
thanks,
Click to expand...
Click to collapse
You should understand that this is not a really booted native linux. Instead you are working in a chroot environment. So there is no kernel running that can get parameters. Only the the stock kernel of your DeFroST. Also there is no FrameBuffer as the graphic hardware ist not accessible. Instead this approach uses a vnc-server to which you can connect via a local viewer.
The advantage of this approach is clear:
- run almost any linux package available in the debian repository
- use your phone as before with the nice android
The disadvantage:
- no graphic output, so no 3D-games (which are rare under linux on the arm platform ;-)
- you can crash your android by eating up to much ram (not such a problem - it restarts on its own and if not you just have to reboot)
Thread is dead?
It seems this thread is dead. The problems many users seem to have come from a dirty setup. The image is broken in many terms:
- wrong file permissions on important binaries, like su
- wrong file permissions on many device files under /dev, so the ttys are only accessible by root
- wrong permissions on other places so there are always errors when installing additonal software (e.g. with the man pages)
- wrong setup that uses the root user for the desktop - instead an unprivileged user should be used
- missing packages for timezones and locales so the time is only right, if you are in a UTC region and console programs having trouble displaying anything else then plain english
I can not recommend using this setup image. It is better to use one of the instructions available online to get a clean setup.
Su doesn't work because your allready root.
Getting anything but root to work would be a real pain.
As you said its a chroot environment, its never going to be perfect.
The image was made using debootstrap just like all the other 'clean' ones.
Yep, it is broken as hell, but it works for what most people would need it for...make,gcc,python,a proper web browser,torrents, and some emergency word processing on the train to work.
The problem most people have is not being able to mount the image, this is due to fro-yo a2sd taking up all the loop devices.
Just thought I'd add my 2 cents.
I tried this on a MIUI rom and the scripy didnt do anything - ie i ran it using:
"# sh /sdcard/deboot"
.....and all it said was:
"#"
I entered all the lines in the shell script but the last one said it failed to launch VLC and no commands registered property (not even ls)
So i tried it on Defrost 5.1, and the script still didn't work.
But when i entered everything manually, it did work. Not too sure about the green theme though.
But thanks alot! Saves me spending a few hours trying to coax a working debootstrap out of my computer.
Thanks!
Josh.
mercianary said:
Su doesn't work because your allready root.
Click to expand...
Click to collapse
Nope. Actually su works only for root. It's missing the setuid root flag like all other binaries that should have it set.
mercianary said:
Getting anything but root to work would be a real pain.
Click to expand...
Click to collapse
Nope. I am always working as a normal, unprivileged user in my chroot. You just have to be in the proper groups. No need to work as root. Android works also with an unprivileged user.
mercianary said:
As you said its a chroot environment, its never going to be perfect.
The image was made using debootstrap just like all the other 'clean' ones.
Yep, it is broken as hell, but it works for what most people would need it for...make,gcc,python,a proper web browser,torrents, and some emergency word processing on the train to work.
Click to expand...
Click to collapse
This is what I do not understand. There is no need that it is broken, as mine works without any errors. So I think something went wrong in creating yours. For sure a chroot is no running OS but you can server almost any service with it and run anything you want (if your ram does not get exhausted ;-).
mercianary said:
The problem most people have is not being able to mount the image, this is due to fro-yo a2sd taking up all the loop devices.
Click to expand...
Click to collapse
Yes. Everyone with a good rom should have a2sd+ (aka the old a2sd) which saves more space than the froyo one and leaves your loop devices for you.
jo

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

[Q] BusyBox 17.2 (with all switches ON)

Hello,
Could somebody please compile BusyBox 17.2 with all the features/utilities turned ON, especially CIFS and NFS (for mount utility)? I know it's not a stable release yet, but instead of compiling a stable one, why not the latest...
The ultimate purpose for me is a future use of "mount", when all necessary modules are published by Dev team.
The next of course would be to compile CIFS and NFS (along with dependencies such as RPC etc.) modules.
Since we don't have a working CIFS modules yet, I was fooling around with NFS and I was able to use older BusyBox builds, where NFS was ON.
I also got very close to mounting a remote NFS share - I used NetRipper's regular kernel, but loaded (modprobe) NFS module (with dependency modules) from NetRipper's USBHOST kernel, making sure that kernel build IDs are the same, otherwise modules would not load...
So everything seemed to be OK, modules loaded, busybox with NFS enabled mount ready, myself excited about what I might have achieved, up until I stumbled on "mounting failed: Not a directory" error... Initially mount command was failing with "mounting failed: Input/output error", then I switched to "TCP" with "nolock" mode, that's when "Not a directory" error surfaced...
I guess there is still some incompatibility with the kernel... just time wasted
Anyway, just created this thread for BusyBox 17.2.
I can attach all other older BusyBox versions that I was able to dig up online, they have different sets of features/utilities and I tested them all. Just let me know if anybody interested.
CJ

[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?

[Q] Connecting to Network Shares

I've been reading as much as I can if it is possible to mount a network share with your Nexus 10. I've downloaded both cifsmanager and mount manager, and can get neither to work.
I can connect to my network with mount manager and some other apps. But getting the Nexus 10 to see your shares as a local folder seems to be a big PIA.
Does anyone have it working, and can they document the steps?
I'm also using CM 10.1, but will flash to any kernel if it can be done.
Thanks
PT
ptmuldoon said:
I've been reading as much as I can if it is possible to mount a network share with your Nexus 10. I've downloaded both cifsmanager and mount manager, and can get neither to work.
I can connect to my network with mount manager and some other apps. But getting the Nexus 10 to see your shares as a local folder seems to be a big PIA.
Does anyone have it working, and can they document the steps?
I'm also using CM 10.1, but will flash to any kernel if it can be done.
Thanks
PT
Click to expand...
Click to collapse
Here is a link that discusses CIFS.
http://goo.gl/ot1mi
Also search for CIFS in the developer's forum that discusses your ROM. The issues with CIFS surround the addition of multi-user support in 4.2.2. That feature meant the mount command needed additional arguments plus you need to create RSA keys. The link above provides that information and other details.
I have it working. Requires a specific set of kernel modules, which means a specific ROM/kernel combination.
I use mrRobinsons AOKP PUB ROM with KTmanta kernel.
After that, I run a script as root to mount the CIFS share, in my case:
Username is the source PC windows username, and then password
The 192.168.1.101\files is the path to my share, extra \ needed for *nix escaping
The /data/media/0/TV-PC is the path on my tablet, empty directory where the mount will occur.
#!/system/bin/sh
#This will mount cifs shares if the network is available
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
busybox mount -t cifs -o username=tv,password=<YOUR_PASSWORD>,rw,file_mode=0777,dir_mode=0777,uid=1000,gid=1000,unc=\\\\192.168.1.101\\files //192.168.1.101/files /data/media/0/TV-PC
sttovo said:
I have it working. Requires a specific set of kernel modules, which means a specific ROM/kernel combination.
I use mrRobinsons AOKP PUB ROM with KTmanta kernel.
After that, I run a script as root to mount the CIFS share, in my case:
Username is the source PC windows username, and then password
The 192.168.1.101\files is the path to my share, extra \ needed for *nix escaping
The /data/media/0/TV-PC is the path on my tablet, empty directory where the mount will occur.
#!/system/bin/sh
#This will mount cifs shares if the network is available
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
busybox mount -t cifs -o username=tv,password=<YOUR_PASSWORD>,rw,file_mode=0777,dir_mode=0777,uid=1000,gid=1000,unc=\\\\192.168.1.101\\files //192.168.1.101/files /data/media/0/TV-PC
Click to expand...
Click to collapse
Thanks Stove. I'm changing to mrRobinsons AOKP PUB ROM with KTmanta kernel.
But when it comes to running the script, do you need to have the app open first before mounting the share? Or will the native apps find everything with not issues?
Just an update that I SSH'd into my Nexus 10 and ran the script in a terminal.
I now see the shares mounted in a terminal. But I do not see anything mounted when in either ES File Explorer any other app.
ptmuldoon said:
Just an update that I SSH'd into my Nexus 10 and ran the script in a terminal.
I now see the shares mounted in a terminal. But I do not see anything mounted when in either ES File Explorer any other app.
Click to expand...
Click to collapse
I think I had this problem too, but I regret I don't remember how i fixed it. I *think* it had something to do with permissions. Did you use the uid and gid arguments that I had in my script? Also, my CIFS mount point is under my data /sdcard (data) mount, if you're mounting under / then that might change things.
I run my script directly from my Nexus 10 in a terminal as root.
May want to look in the thread linked below, this is where I got what I needed for the script.
Edit - check post 62 in this link. Looks like it's related to setting the ownership bits… 0777
http://forum.xda-developers.com/showthread.php?t=2003836
I use esfileexplorer to access my samba shares. It's not a permanent mount in the root fs, but i can watch videos thid way.
nvertigo67 said:
I use esfileexplorer to access my samba shares. It's not a permanent mount in the root fs, but i can watch videos thid way.
Click to expand...
Click to collapse
Yes, but that's not the same as mounting a shared network folder. The idea is for all native apps to see your media as if it was locally on your device
sttovo said:
I think I had this problem too, but I regret I don't remember how i fixed it. I *think* it had something to do with permissions. Did you use the uid and gid arguments that I had in my script? Also, my CIFS mount point is under my data /sdcard (data) mount, if you're mounting under / then that might change things.
I run my script directly from my Nexus 10 in a terminal as root.
May want to look in the thread linked below, this is where I got what I needed for the script.
Edit - check post 62 in this link. Looks like it's related to setting the ownership bits… 0777
http://forum.xda-developers.com/showthread.php?t=2003836
Click to expand...
Click to collapse
Sttove.. You may be on to something. .. The script/mount command already is suing 0777, but I noticed i could not create a folder in terminal after mounting the share.
I hope to do some more testing and research when I get back home tonight.
ptmuldoon said:
Yes, but that's not the same as mounting a shared network folder. The idea is for all native apps to see your media as if it was locally on your device
Sttove.. You may be on to something. .. The script/mount command already is suing 0777, but I noticed i could not create a folder in terminal after mounting the share.
I hope to do some more testing and research when I get back home tonight.
Click to expand...
Click to collapse
One other thing I just thought of, how is your share setup on the server side? If you go into Advanced Sharing for the share, then Permissions, make sure you have Everyone set to read, write, etc… That leaves your share wide open, but at least something you can test.
sttovo said:
One other thing I just thought of, how is your share setup on the server side? If you go into Advanced Sharing for the share, then Permissions, make sure you have Everyone set to read, write, etc… That leaves your share wide open, but at least something you can test.
Click to expand...
Click to collapse
I can SSH into the Nexus10 via a terminal/putty from a PC. Create the mount point, and then see my share info. I am then also able to create a directory in terminal as well.
But when I than go to the Nexus and ESFile Explorer or any other app, the mapped share folder is blank.
I think I read something on blank mount/shares, but will have to keep looking into it.
Has anyone seen that happen before and know its cause?

Categories

Resources