View Full Version : Newbie - I can't get NFS to work
AndyCooll
2005-06-25, 05:49 PM CDT
As a Linux newbie I'm having big big problems getting my head round networking (see another post of mine: Problems accessing my share folders (http://www.fedoraforum.org/forum/showthread.php?t=60970). I've got stuck with Samba (I can see and access my WinXP share folders, but my WinXP pc cannot share FC4 shares)
Anyway, I decided to have a go at the other shae problem. NFS isn't working either. I searched Linux Google and found a Howto. (NFS-Howto (http://www.linux.org/docs/ldp/howto/NFS-HOWTO/intro.html))
I get to section 3.3.2 and verify that "prtmap" is running. So far so good.
Point 3.3.3 of this article says I need to make sure the following daemons are running:
rpc.portmap
rpc.mountd,
rpc.nfsd
rpc.statd,
rpc.lockd (if necessary),
rpc.rquotad
and if they aren't I should add them. It says they are all part of the nfs-utils package. As a Linux newbie my questions to that are "How do I make sure the daemons are running? And if they aren't where do I add tham and how? Where do I get nfs-utils from?" :confused:
It also says that I can verify NFS is running by typing: "rpcinfo -p". However when I type this I get a coomand not found message. It then goes on to talk about "exportfs -ra" (another failed command).
By this stage I'm totally frutrated and totally confused. I want to make a success of my switch to Linux but it's proving very hard :(
Please, please, please... any help on what I'm doing (or not doing) wrong would be appreciated
Brian1
2005-06-25, 07:16 PM CDT
nfs should be fairly easy to since reading your other post that you have disabled the firewall. I assume SE Linux as well. All I every did in FC3 and back to Caldera 2.4 I only added the line needed in /etc/exports like this and start the nfs service.
/etc/exports contents
/storage1/ 192.168.1.0/255.255.255.0(rw,sync)
Reason it does not find the command rpcinfo is because it is not in your default path. It is located in /usr/sbin. It is default to root but not as a user or as su. Only as root or using su -. When su is used it still uses the orginal users envirmonet varibles for the most part. So to use it type su - instaed of su.
To see if the service is up type ' service --status-all | grep nfs as root.
Post your exports file contents.
Brian1
Brian1
2005-06-25, 07:21 PM CDT
Addition info. Nfs is mostly for networking between Linux Unix machines on the same subnet. There are a few windows nfs clients but they do lack in preformance versus using samba instead for mixed OS networking.
Brian1
AndyCooll
2005-06-26, 04:52 PM CDT
Thanks for helping Brian, it really is appreciated. :)
Doing what you said, I re-tried "rpcinfo -p" and this time came up with:
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 32768 status
100024 1 tcp 32769 status
100011 1 udp 1003 rquotad
100011 2 udp 1003 rquotad
100011 1 tcp 1006 rquotad
100011 2 tcp 1006 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 udp 32770 nlockmgr
100021 3 udp 32770 nlockmgr
100021 4 udp 32770 nlockmgr
100021 1 tcp 32770 nlockmgr
100021 3 tcp 32770 nlockmgr
100021 4 tcp 32770 nlockmgr
100005 1 udp 606 mountd
100005 1 tcp 609 mountd
100005 2 udp 606 mountd
100005 2 tcp 609 mountd
100005 3 udp 606 mountd
100005 3 tcp 609 mountd
When I type "service --status-all | grep nfs" I get:
Device not specified in /etc/sysconfig/diskdump
rndc: connect failed: connection refused
Server address not specified in /etc/sysconfig/netdump
nfsd (pid 2124 2123 2122 2121 2120 2119 2118 2117) is running...
And finally my exports contents are:
/home/andy/share/ 192.168.2.0/255.255.255.0(rw,async) \
/home/andy/downloads/ 192.168.2.0/255.255.255.0(rw,async) \
AndyCooll
2005-06-27, 04:26 PM CDT
A further update. After further tinkering I've now got each pc to see the "share" folder I've set up on each. However when I try to mount them I get the error message:
"mount ... failed reason given by server "permission denied"
Both pc's are on the same network, logon with the same user and have the same password.
I've checked exports, host.conf, hosts, hosts.allow, hosts.deny and everything seems ok, syntax is correct and as Howto's say they should be, and as described in various threads on the boards.
I've run "exportfs -a", re-started nfs, and run "rpcinfo -p". As you can see above portmapper, nfs and mountd are running
So... what's still missing? :confused:
Brian1
2005-06-27, 06:13 PM CDT
The command "service --status-all | grep nfs" needs to be ran as root or su -. Not as a user. The rpcinfo contents looks fine. The exports file looks fine as well. If you have identical users setup on both machines with the same password, then the last thought is permissions on the directory on the local machine. If you are trying to mount the share export from the server and mount it on the client side say on /mnt/share, then that might be your permissions issue. Changed the permissions on /mnt/share like ' chmod 777 /mnt/share ' if that does not help try ' chmod +s /etc/share '. To make sure you understand this is the mount point on the local machine not the server side.
The way I mount is from my fstab file. It has aline like this.
192.168.1.18:/storage1 /mnt/lcomp18_storage1 nfs umask=000,users,noauto,owner,rw,sync,dirsync 0 0
The umask=000 allows the anyone to mount to /mnt/share whether root or not. So when I goto mount it I just type ' mount /mnt/lcomp18_storage1 '. Since the info for the mount is in my fstab file I don't need to supply all the needed mount info.
See how that goes for you. I will look over your other post on samba later.
Brian1
AndyCooll
2005-06-28, 04:49 PM CDT
Brian, thanks for your thoughts.
I think I'll have to have another go with this tomorrow, for it seems many of my settings have disappeared. My host.conf doesn't have anything in it today
So when I tried re-starting nfs I got:
[root@officeone ~]# etc/rc.d/init.d/nfs restart
bash: etc/rc.d/init.d/nfs: No such file or directory
And for my service status I get:
[root@officeone ~]# service --status-all|grep nfs
Device not specified in /etc/sysconfig/diskdump
rndc: connect failed: connection refused
Server address not specified in /etc/sysconfig/netdump
nfsd (pid 2133 2132 2131 2130 2129 2128 2127 2126) is running...
The command I was using yesterday was:
# mount server:/home/andy/share /mnt/home/andy/share
Today, this says the mount doesn't exist (probably because there's no host in my host.conf. Anyway, it's getting close to midnight here in the UK, my brain is mashed so I'll have to try and get my head round this and chmod and fstab tomorrow or Thursday.
Thanks for your patience
AndyCooll
2005-07-01, 04:03 AM CDT
Well... my update is that I've tried this again, I've put the details in the fstab (almost exactly the way you suggest) and yet I'm still getting the "failed: permission denied" message. In fact, now its part of my fstab file I notice I get a message during the boot process saying the same thing.
I did notice that I was getting some errors linked to nfs and nstad when closing down, so I'll try and catch what they were when I get time tonight
bärtil
2005-07-01, 08:16 AM CDT
Did you modify /etc/hosts.allow? see man hosts.allow
Omega Blue
2005-07-05, 01:49 AM CDT
A further update. After further tinkering I've now got each pc to see the "share" folder I've set up on each. However when I try to mount them I get the error message:
"mount ... failed reason given by server "permission denied"
Check the permissions on these directories.
veeraafed
2005-07-05, 04:38 AM CDT
Well... my update is that I've tried this again, I've put the details in the fstab (almost exactly the way you suggest) and yet I'm still getting the "failed: permission denied" message. In fact, now its part of my fstab file I notice I get a message during the boot process saying the same thing.
I did notice that I was getting some errors linked to nfs and nstad when closing down, so I'll try and catch what they were when I get time tonight
hello friend,
whats ur problem
consider u have two system names are system1=192.168.1.1,system2=192.168.1.2
let assume u r going to share folders in system1 and system2 is going to access the folder in system1.
In system1 u plz check portmap and nfs demon r running "netstat -at" and u r going to share the folder /data in system1
system1#vi /etc/exports
/data 192.168.1.0/24(rw,sync) and save the file
system#exportfs -r (to update)
system1#showmount -e localhost (it ll show u what r the directory its sharing)
and plz check ur firewall is allowing the nfs service
and go system2
syetm2#shomount -e 192.168.1.1 (before running this first check portmap is runing in ur system2)
system2#mount -t nfs 192.168.1.1:/data /mnt/data1
if u have any premission problem u plz post the problem
AndyCooll
2005-07-05, 06:27 PM CDT
Thanks for the words of advice guys, however I'm still getting the permission denied message.
I'm not running a firewall (though I'm behind my routers firewall).
All files are shared with full permissions
portmap is running, nfs is running, folder is exported (it shows in "showmount")
I've modified hosts.allow as "man" says
Omega Blue
2005-07-05, 07:29 PM CDT
Not files, the directories ('folders' in Windows-speak).
veeraafed
2005-07-06, 12:19 AM CDT
Thanks for the words of advice guys, however I'm still getting the permission denied message.
I'm not running a firewall (though I'm behind my routers firewall).
All files are shared with full permissions
portmap is running, nfs is running, folder is exported (it shows in "showmount")
I've modified hosts.allow as "man" says
dear friend,
could u plz post me the detialed information about ur permission problem
AndyCooll
2005-07-07, 01:37 PM CDT
Not files, the directories ('folders' in Windows-speak).
My apologies, however I did understand you. Let me re-phrase that... all directories have full shares
AndyCooll
2005-09-29, 06:12 AM CDT
It's taken me awhile, but I thought I ought to post back and let you know that I have eventually got NFS working. Heaven knows what I was doing wrong, but this time it was easy (it always is in retrospect isn't it?). My confession is that it took me using Ubuntu and Debian before I solved it.
After ensuring nfs was running I then shared a folder. I checked my exports file and the share showed a simple:
192.168.2.0/255.255.255.0(rw)
On my second box I then created a mount folder (nfsshare) using "mkdir".
Finally my mount command was a simple:
mount 192.168.2.3:/home/andy /mnt/nfsshare
Just wanted to share my results. :)
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.