NFS Portmap: RPC: Program not registered
Over the past 9 months or so, this problem has been a recurring issue. It would go away only to return at a later date. It was getting to be very annoying. The crunch came this morning when I opened the XEON box in order to disconnect a noisy fan on a video card. Don’t worry, the card actually has lots of ventilation already. It has an exchaust fan right beside it (less than 4mm from the heatsink on the card.When I restarted the box, which acts both as an NFS server and an NFS client, the boot process was paused with the following message:
Mounting NFS file systemsNFS Portmap: RPC: Program not registered
I also found the following messages in /var/log/messages
on the NFS
server:
portmap[83487]: connect from 192.168.0.18 to getport(mountd): request from unauthorized host
portmap[83517]: connect from 192.168.0.18 to getport(nfs): request from unauthorized host
I mentioned this on IRC, and Unfurl suggested it was an /etc/hosts.allow
(i.e. tcpwrappers) issue. He suggested I change allow all for portmap. I did.
Rebooted the client box (as that’s the situation under which the problem occurred).
This time, the box rebooted properly and the NFS partitions were properly mounted.
Here’s what I had in /etc/hosts.allow
:
# Portmapper is used for all RPC services; protect your NFS!
# (IP addresses rather than hostnames *MUST* be used here)
portmap : 192.0.2.32/255.255.255.224 : allow
portmap : 192.0.2.96/255.255.255.224 : allow
portmap : ALL : deny
Here’s what I changed it to:
# Portmapper is used for all RPC services; protect your NFS!
# (IP addresses rather than hostnames *MUST* be used here)
portmap : 192.0.2.32/255.255.255.224 : allow
portmap : 192.0.2.96/255.255.255.224 : allow
portmap : 192.168.0.0/255.255.255.0 : allow
portmap : ALL : deny
The original problem (added on 27 June 2000)
Today after I rebooted two boxes, I found that one couldn’t remount some NFS partitions which resided on the other box. During the boot process, the following message was displayed (it is split into two lines here for readability):Mounting NFS file systemsNFS Portmap: RPC: Program not registered
This was on the client box. The server box seemed fine. I pressed control-C to allow the box to continue booting. Then I tried to mount the partitions manually:
mount /www/unixathome.org/adsl NFS Portmap: RPC: Program not registered
Following some advice, I did the following (but before you do that, see also the next section for more information):
On the server (kill the NFS daemon, restart mountd, and restartd the NFS daemon):
killall -TERM nfsd killall -hup mountd nfsd -u -t -n 4
One the client:
mount -v myserver:/nfs/path/ /local/path
where myserver is the name of the NFS server and /local/path is the mount point on the local box.
The above process worked. The mount succeeded. Life goes on.
More information (added on 15 July 2000)
Each time I reboot the NFS server, I find that the clients can’t access it. In the logs on the client, I find this:nfs server mynfsserver:/path/to/stuff: not responding
So on the server I do this:
killall -term nfsd nfsd -u -t -n 4
Soon afterwards, I find messages like this in the client:
nfs server mynfsserver:/path/to/stuff: is alive again
I also noticed that one of my mounts doesn’t mount properly. And that mountd was not running on the server. So I started it manually by issuing the command:
mountd
Then, on the client, I manually mounted the missing volumes. e.g.:
# mount -v ducky:/nfs/path /path/to/local/mount/point ducky:/nfs/path on /path/to/local/mount/point (nfs)
(posted by Dan Langille)
Mounting NFS file systemsNFS Portmap: RPC: Program not registered
This is a generic message.
NFS client can do D.O.S on your server
I get this problem and have a new solution
The serveur was busy: a top show nfsd: CPU 90-46%
390 root 20 0 0 0 0 RW 0 46.0 0.0 7549m nfsd
many clients use the server as same time
for example on a mandrake by default crontab use /etc/cron.daily/slocate.cron which don’t exclude nfs mount point.
#!/bin/sh
[ -e /usr/bin/updatedb ] && { sh /usr/bin/updatedb; } || {
/usr/bin/slocate -u -e /tmp -e "/var/tmp,/usr/tmp,/afs,/net,/proc,/add-your-nfs-mount-point";
}
a new top after this correction:
390 root 0 0 0 0 0 SW 0 0.0 0.0 7554m nfsd
But i think the best is to add this line to to exclude all NFS mount point.
#!/bin/sh
[ -e /usr/bin/updatedb ] && { sh /usr/bin/updatedb; } || {
/usr/bin/slocate -u -e /tmp
-e "/var/tmp,/usr/tmp,/afs,/net,/proc,/add-your-nfs-mount-point"
}
[ -e /usr/bin/updatedb ] && { sh /usr/bin/updatedb; } || {
/usr/bin/slocate -u -e /tmp
-e "/var/tmp,/usr/tmp,/afs,/net,/proc,"
-e mount | grep nfs | awk ‘{ print $3 "," }’;
}
I also ran into the same problem on a SUN box. for some reason the RPC procedure did not acutally run when the system started. but when I manually started it it came up fine. still looking into the reason.
I solved this by running rpcbind, nfsd and then mountd in that sequence. Seems like nfsd doesn’t register itself with rpcbind somehow (no guru here) if you start it before rpcbind.
I ran into this same problem, from your article I changed
portmap : 192.1.1.10/255.255.255.224 : allow
to
portmap : 192.1.1.10/255.255.255.0 : allow
in hosts allow and it fixed the problem. BTW the
server is running FreeBSD 4.10 and the client is
FreeBSD 5.3. Thanks so much for providing this
helpful information!
-Mike