LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Nfs (https://www.linuxquestions.org/questions/linux-newbie-8/nfs-39566/)

nero64 12-27-2002 09:55 PM

Nfs
 
I can't seem to share out a directory from one of my Linux machines.

I have networked two machines. I can ping each other by names and by IP addresses. Both computers have each others details in the /etc/hosts file. I tried to set them up in a domain but i can't get any feed back when i do nslookup.

I followed the NFS chapter straight out of the linux bible which covers RH 7.1. On the server in the /etc/exports i put the share and the permissions. On the client machine i put the server name:shared folder mount point etc. When the client boots up or when i try and mount the share i get the follwing: mount: RPC: Unable to receive; errno = connection refused

trickykid 12-27-2002 10:04 PM

After setting up your exports and hosts file, adding maybe the mounts in the fstab file, did you restart the NFS server daemon on the server side ?? I got errors like that once and it drove me nuts, then after about 30 minutes I thought to myself, I'm an idiot, I haven't restarted the NFS services on the server itself.

Maybe that will do it for you, maybe not. Let us know !

And if you can, try to post your /etc/exports, /etc/hosts, and /etc/fstab if you want and it might help us determine the problem if restarting the server doesn't do the trick.

nero64 12-28-2002 02:53 AM

Here is the /etc/hosts file on my server which i have called linux620. The client is linux200. The domain i made up i am not sure if it works. I can ping the client though.

127.0.0.1 localhost localhost.localdomain
192.168.0.1 linux620 linux620.johndomain.com
192.168.0.5 linux200 linux200.johndomain.com

This the /etc/exports file on my server. I used The exact IP to see if i could get it to work. I have called the share nfsshare of /

/nfsshare 192.168.0.5/255.255.255.0(ro,no_root_squash)

Here is the /etc/fstab file on the client linux200. i created the /mnt/nfs directory

linux620:/nfsshare /mnt/nfs nfs rsize=8192,wsize=8192 0 0

My book told me to install sunrpc and nfsd modules. I did the former but the nfsd got the unresolved symbol message. When i do lsmod i can't see the nfsd listed. I restarted nfs but i still get the error on the client. I have rebooted both and i get the same.

trickykid 12-28-2002 10:37 AM

Quote:

This the /etc/exports file on my server. I used The exact IP to see if i could get it to work. I have called the share nfsshare of /

/nfsshare 192.168.0.5/255.255.255.0(ro,no_root_squash)

Try this instead just as a basic setting if you want read-only for the share:

/nfsshare 192.168.0.5(ro)

That should default it to read-only and also test it without specifiying the no_root_squash

Quote:

Here is the /etc/fstab file on the client linux200. i created the /mnt/nfs directory

linux620:/nfsshare /mnt/nfs nfs rsize=8192,wsize=8192 0 0

Try this instead as you don't need the two 0 0 at the end:

linux620:/nfsshare /mnt/nfs nfs rsize=8192,wsize=8192,timeo=14

Also check your permissions on the share you have, make sure the world has at least read access if your only wanting to make it read-only.

Then just restart the nfsd daemons on the server as root with: nfsd restart (you might have to put the full path like /etc/rc.d/nfsd restart for example to where ever your nfsd script is stored) and then on the client as root just perform a mount -a to see if it mounts the share with no errors. This just keeps you from having to reboot after every change which is unecessary.
Also a side note, when you do a lsmod, it won't show the nfsd cause your specifying to lists modules, nfsd is a daemon.. :)

Let us know if this works !

nero64 12-29-2002 02:06 AM

still getting the same error. My book says i should have the module nfsd loaded and it lists it as being loaded in the /lib/modules/kernel dir. When i do a find on it it gives me a location of /usr/include/linux/nfsd/nfsd.o. I can restart nfs but not nfsd. But isn't nfs the daemon anyway. The book does a lsmod showing under modules nfsd.

All the permissions on the dir share are correct. I use the root account on both client and server and the same password. That shouldn't matter should it.

I can ping each computer, but isn't it reading the /etc/hosts file. How do i know if they are really connected on a network.

trickykid 12-29-2002 10:46 AM

My mind must have been elsewhere, yeah you should have a nfsd module loaded.

What happens if you do a: /sbin/modprobe nfsd ??

If you can ping each computer and get replies, that means they have a network connection. But it seems without that nfsd module you won't get them connected til that is loaded.

nero64 12-29-2002 09:27 PM

I think the problem must be at the client end.

I managed to get nfsd loaded with that modprobe command and it shows up when i do lsmod and rpcinfo -p

All the required modules are loaded and i get no errors. My distro uses rpc.mountd and rpc.nfsd located in /usr/sbin and i start them by typing them at the command prompt(well that is what my book says).

Now when i do exportfs -av it says:
exporting 192.168.0.5:/nfsshare
reexporting 192.168.0.5:/nfsshare to kernel
The IP is that of the client. It is telling me that it is setting it up on the client. That is right isn't it.

I have installed all the modules etc on the client as well. I have put the line in the /etc/fstab file. but when i do the mount -a command i still get that error.

When i do lsmod the nfsd module says that it is not used by anyone (ie the field is blank). Does this matter?

trickykid 12-29-2002 09:38 PM

Quote:

Originally posted by nero64
I have installed all the modules etc on the client as well. I have put the line in the /etc/fstab file. but when i do the mount -a command i still get that error.

When i do lsmod the nfsd module says that it is not used by anyone (ie the field is blank). Does this matter?

Well as far as I know the client side doesn't need the nfsd module loaded, only for the server.

That is fine if it states its not being used by anyone, probably most likely at this time since your client isn't connecting to it.

What distro are you using by the way ?

nero64 12-31-2002 01:06 AM

I'm using Red Hat 7.1.

When I start up the server it doesn't load nfsd or sunrpc.
Then when i install all the required stuff and i shutdown the computer i get failed when it shutdowns nfs and mountd services.

Anyway i think i have spent enough time on this. I have learnt a few things and i will try and get it running when i install Red Hat 8.0.

Thanks for the help trickykid


All times are GMT -5. The time now is 09:31 AM.