NFS problemsForum: Networking Topic: NFS problems started by: andrewb Posted by andrewb on June 12 2008,13:35
Trying to use NFS to connect 2 DSL machines. v4.4RC1 on the server & 3.1 on the client. nfs-kernel-server.dsl loaded on server.On the server /etc/export contains: /home/dsl *(rw) /etc/hosts contains ip & hostname of client /etc/hosts.allow & deny are empty started: portmap nfs-common nfs-kernel-server modprobe nfs On the client /etc/hosts contains ip & hostname of server sudo modprobe nfs sudo mount <servername>:/home/dsl tnfs (tnfs is directory in /home/dsl) return error: Permission denied sudo showmount -e <servername> gives: /ramdisk/home/dsl * I have also tried <servername>:/ramdisk/home/dsl & replacing <servername> with the ip address. Also tried mounting exported directory on server (i.e. mount localhost:/home/dsl <mount_dir>) & still get the permission denied message. /proc/fs/nfs/exports contains: # Version 1.1 # Path Client(Flags) # IPs i.e. no exports listed? nfsd is running on the server & rpcinfo reports portmapper, status, nfs, nlockmgr & mountd all present Has anyone got nfs working between 2 dsl machines? Posted by Jason W on June 12 2008,16:23
On the client, do you have portmap and nfs-common started? On the client I sometimes have to set a static ip address for nfs to work without the permission denied thing. And that is regardless what distribution is running on the server or client.Also, on the server, /etc/hosts.allow may need to read like this, assuming your network is 192.168.0.0: lockd: 192.168.0.0/255.255.255.0 statd: 192.168.0.0/255.255.255.0 portmap: 192.168.0.0/255.255.255.0 nfsd: 192.168.0.0/255.255.255.0 mountd: 192.168.0.0/255.255.255.0 Posted by chaostic on June 12 2008,22:18
Run "rpcinfo -p [ host ]" on the client, both to the server hostname/ip and loopback.Edit: Also found a nice NFS troubleshooting guide < http://publib.boulder.ibm.com/infocen....obs.htm > Posted by andrewb on June 12 2008,23:15
I have tried Jason's suggestion for hosts.allow & that doesn't change anything.I did try loading portmap & nfs-common on the client - also modprobe nfs on the server. Again this didn't change anything. rpcinfo for the client (from either machine) gives an error (not at my 2 dsl machines at the moment, but it was something about rpc not being registered IIRC). Haven't tried the static IP. Nonetheless - why can't I even mount exported directories on the same machine as they are exported from? Posted by chaostic on June 12 2008,23:21
Try running "ps auxww | grep -i 'rpc'" Does it return any processes for rpc.d or rpc.stat or rpc anything? Edit: Try making sure both portmap and rpc.statd are running on the client. Then connect. Also, did you run "/usr/sbin/exportfs -a"? It might show an error with the exports file syntax preventing things from working correctly. Oh, and try running nfsd in the foreground, to see if you can catch any errors that might otherwise be sent to /dev/null. Posted by andrewb on June 12 2008,23:48
OK, Looking through the info in the link above, ps shows 8 instances of nfsd running, plus rpciod & lockd - all have the status SW. The above link refers to the startsrc command & /etc/rc.nfs files - neither of which are present.I've used exportfs -rav & no errors were reported. showmount -p <servername> reported the directories exported as expected Posted by curaga on June 13 2008,08:08
Sorry to be unhelpful, but no other support than kernel is needed on the client - I accidentally had a fresh system and didn't feel like getting nfsd, so I just had the kernel support for NFS client, and to my amazement (and laziness ) it worked just fine, I only got a complaint that since portmap and lockd were not available, I could not have file locking and that would bring issues if anyone else connected at the same time.Since I was the only client to my server, it didn't matter at the time. Just saying those aren't needed on the client, and your problem lies elsewhere.. Posted by ^thehatsrule^ on June 13 2008,08:28
Maybe check the permissions on the remote (and maybe local) directory. If you can, maybe just try and allow everyone to have access on it. (I haven't used nfs in a while, but I seem to remember some kind of problem like this)
Posted by chaostic on June 13 2008,20:05
I was reading the mount_nfs man page (On OSX, the Linux one might be different)It's error section says:
So, lets try the most obvious thing. Try rewriting the exports file to have two entries. One for the server, one for the client, with explicit ip's instead of hostnames or catchalls. Then restart every server/daemon and try again. Posted by andrewb on June 16 2008,03:42
OK,still not getting NFS to work. I have reduced the test to a single machine. I am using dsl v3.4.11, booted as 'dsl base norestore'. I am using the machine as both client & server to mount directory /home/dsl at /mnt/ttt. the sequence I am using is: download nfs-kernel-server.dsl load nfs-kernel-server.dsl run emelfm as root: set permissions for /home/dsl to rwx for all users & recurese subdirectories create /mnt/ttt & set permissions as above. edit /etc/exports: add "/home/dsl *(rw)" delete /etc/hosts.allow & deny copy contents of /etc/hosts (a symlinked file) to a new file in beaver & edit to add line "box 10.0.2.15" (ip of the machine). delete 'box' as hostname for 127.0.0.1 delete /etc/hosts save new file from beaver (above) as /etc/hosts open root teminal:
modprobe nfs showmount gives the same for box, localhost, 127.0.0.1 & 10.0.2.15 rpcinfo & mount then give:
using localhost, 127.0.0.1 or 10.0.2.15 in place of box gives the same result. Then tried adding hosts directly to /etc/exports i.e.:
this then gave:
?? Posted by curaga on June 16 2008,09:16
I just remembered tmpfs cannot be exported by NFS. Not too sure about unionfs either.So, create a 4MB ramdisk with ext2, try to export that, it should work. (dd if=/dev/zero of=/dev/ram2 bs=1M count=4; mke2fs -m0 /dev/ram2) Posted by chaostic on June 16 2008,09:18
Or export the cdrom.Sidenote: Wait, is that's all that is required to make a ram disk in linux? I needed a way of storing a continuous written to file without writing it to a harddrive/flash. Posted by curaga on June 16 2008,10:57
Yes. Although the max size is defined when compiling the kernel and is usually 4MB, and the max number of ramdisks is also defined compile-time, the default is 16. Most people use tmpfs instead, since it's newer, faster, and can be resized on the fly, but old-fashioned ramdisks have their uses. Posted by andrewb on June 17 2008,02:22
Looks like that is the problem. Creating the ramdisk & mounting it to /mnt/r2 & then exporting that allowed it to be mounted back to the same machine. I think this needs a wiki page to explain. I'll put it on my list of pages to do, along with the DMIX/umix one requested elsewhere. Thanks for the help. Posted by Jason W on June 17 2008,02:56
andrewb,I never tried to export directories that are in unionfs/tmpfs, only hard drive directories. I will update the info file in nfs-kernel-server.dsl with what you put in the wiki. Thanks. Posted by andrewb on June 17 2008,07:39
I have confirmed that it is the tmpfs filesystem (i.e. /ramdisk) that nfs won't export/mount. Also unionfs won't export/mount (I created two directories on a hard-drive & made them into a union in a 3rd directory on the hard drive, exported it & then got the 'permission denied' error message). This really needs to be clearly documented, particularly for newbies - it would have taken a lot of trial & error to sort this out had I not had the help from curga & chaostic._ To summarise - how to get nfs working on dsl with the least hassle NOT SECURE! (read the nfs-howto to set secure options): nfs won't work with tmpfs - this is any directory/file found listed in the /ramdisk directory for dsl nfs won't work with unionfs - any directory listed by the listu command (note: there are some exceptions to the above sweeping statements - see at the bottom of this post) On the server: load nfs-kernel-server.dsl extension as root (either root terminal, emelfm as superuser or sudo in user terminal) do the following: list directories to be exported in /etc/exportfs e.g. to export /cdrom put the line:
in /etc/exports delete /etc/hosts.deny & hosts.allow put the client hostname & ip into /etc/hosts start the nfs services:
_ On the client as root (i.e. either in a root terminal or sudo in a user terminal):
_ If the exported directories on the server need to be changed: edit /etc/exports & then as root execute
_ notes about unions: from trying various permutations I have found the following: I created 3 directories on a hard drive u1, u2 & ux. u1 & u2 contained files. The directories were made into a union in ux. Whilts part of the union u1 & u2 can be exported & mounted by nfs, ux cannot - i.e. the union directory cannot be mounted, but the directories contained in the union can be (so long as they don't have some other restriction, such as being on a tmpfs filesystem like /ramdisk). If u1 & u2 are made into a union in u2 then u1 exports/mounts ok, but u2 does not export/mount. Posted by curaga on June 17 2008,08:33
Yes, this is something hidden deep in the book of darkest magicks, not in any man pages for sure.It's not even in the kernel docs about tmpfs or unionfs. But I'm sure I've read the fact about tmpfs somewhere, and unionfs is by experince.. |