1825771 Members
2144 Online
109687 Solutions
New Discussion

nfs server

 
SOLVED
Go to solution
Tarek_1
Frequent Advisor

nfs server

Hi there,
i want to enable nfs server on my redhat 7.2 box in order to export a directory.
I'm not sure if during installation i have installed nfs, however there's installed nfs-utils-0.3.1-13. I checked if there's a nfs-server installed but it doesn't seem to be.
I followed the following steps:

On the server:
- configured /etc/exports
/home/tarek myws(rw)
-exportfs -a
- started /etc/rc.d/init.d/nfs daemon.

On the client: (another RH 7.2 box)
- mkdir /mnt/myws
- chmod 755 myws
- mount myws:/home/tarek /mnt/myws

But i get this error:
mount: RPC: Unable to receive; errno = Connection refused

Am i'm missing something?
All these actions i've performed them as root.
Thanks in advance
Tarek
11 REPLIES 11
Tarek_1
Frequent Advisor

Re: nfs server

Sorry in the /etc/exports the entry is /home/tarek client(rw).
Craig Kelley
Valued Contributor
Solution

Re: nfs server

Be certain the portmapper is running on the server:

/etc/init.d/portmap start

If that doesn't solve your problem, then you may have a firewall setup (run 'lokkit' as the root user on the server).

Steven Mertens
Trusted Contributor

Re: nfs server

hi tarek,

For nfs to work you must have the following
rpms installed :

[root@hive root]# rpm -qa |grep nfs
nfs-utils-0.3.1-13
[root@hive root]# rpm -qa | grep portmap
portmap-4.0-38

nfs-utils-0.3.1-13.i386.rpm
portmap-4.0-38.i386.rpm

install them with rpm -ivh .

then you must first start portmap &
after that nfs

service portmap start
service nfs start

See also you have the same stuff running
at your client.

Like mentioned above, if that doesnt work
check your firewall settings.

regards

Steven
Tarek_1
Frequent Advisor

Re: nfs server

Ok guys... that was it. Portmap wasn't running and on the server there was the firewall.
But now i've got another error:

mount: myws:/home/tarek failed, reason given by server: Permission denied

On the server the directory is exported as rw for myws..
Another thing just to understand how nfs works under linux.
Under othere unix systems you can start two services, nfs.client and nfs.server. Here, as i've seen, there's only nfs and you told me to start it also on the client. So, potentially, also my client is a server and it has started the nfsd server daemon, right??

Thanks again
Tarek
Stuart Browne
Honored Contributor

Re: nfs server

Did you start 'portmap' before or after 'nfs' ?

It's very important that Portmap is started first.

That being said, if you run the command 'rpcinfo -p', what does it report?
One long-haired git at your service...
Tarek_1
Frequent Advisor

Re: nfs server

Portmap was started first, however i did it again but I got the same error.
rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 967 rquotad
100011 2 udp 967 rquotad
100011 1 tcp 970 rquotad
100011 2 tcp 970 rquotad
100005 3 udp 32877 mountd
100005 3 tcp 50511 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32878 nlockmgr
100021 3 udp 32878 nlockmgr
100021 4 udp 32878 nlockmgr
Stuart Browne
Honored Contributor

Re: nfs server

Ok, that looks good. NFS 2 and 3..

Now, you mentioned somewhere above that you've got a firewall in place. That command lists the ports that the various servers are listening on. Are they being blocked by your firewall?

It's probably going to come down to resolving however. You've used the name 'myws'. Make sure that the name you use int he exports file is what your NFS server thinks it is. You might need to play with FQDN's to get it right.

If that still doesn't work, umm.. Have you read the NFS howto? :)
One long-haired git at your service...
Tarek_1
Frequent Advisor

Re: nfs server

oops.. there was an error in the /etc/exports file.
Now everything's ok... thanks for your help.
Tarek

Tarek_1
Frequent Advisor

Re: nfs server

..still a problem.
I mount the directory as root and i want that user oracle can work on that directory.
On the server the directory is oracle's property, while on the client it's tarek property.
Now i've seen that on the server there are these id's:
oracle:502:302
tarek:500:300
On the client:
oracle:300:302
tarek:502:100
So I think the problem is id's related.
Now is there a way to change id's without causing problems to the system?? I want that the match exactly on the two ws. If i change them i have to make a chown -R on all files right? Can this be done automatically while i modify id's?
Thanks again..
Steven Mertens
Trusted Contributor

Re: nfs server

hi Tarek ,

When you use nfs, the savest is always
use the same uid and gid for users on all
your systems. If you change the ownership
off the nfsmounted fs on the client to
oracle , you will see on the server that
the owersship changed to the uid of user oracle on the client.
I would change the uid on the client from
user oracle.

Steven
Stuart Browne
Honored Contributor

Re: nfs server

Yup. Changing UID's on the machine with the last amount of stuff using the files is the best..


find . -user -exec chown {} \;

could always be useful.. Don't forget groups.
One long-haired git at your service...