Upgrading NFS server
This document describes how to upgrade nfs-utils without trashing NFS. It assumes you have a working NFS already. Check the NFS-HOWTO or linuxsetup23.html for more details on setting up NFS.
If you ever get the urge to upgrade the NFS or rpc commands on your server, think twice. The upgrade may go smoothly or you may lose hours of time struggling to repair the system.
Upgrading
- Download new nfs-utils, and grab a copy of portmap (which hasn't changed
in quite a while).
nfs-utils = http://sourceforge.net/projects/nfs
portmap = ftp.porcupine.org/pub/security - Backup the following files, which should be in /usr/sbin. If installation
fails, copying these files back and reboot should restore the original state.
exportfs
rpc.mountd
rpc.nfsd
rpc.statd
nfsstat
rpc.rquotad
showmount
nhfsstone
nhfsrun
nhfsnums
nhfsgraph
rpc.lockd
- Build nfs-utils
tar -xzvf nfs-utils-1.0.1.tar.gz cd * configure make make install (as root)
- Restart nfsserver
If the startup scripts are not present, start NFS server by hand by starting the daemons in the following order:/etc/rc.d/portmap restart /etc/rc.d/nfs restart /etc/rc.d/nfsserver restart
portmap rpc.mountd rpc.nfsd rpc.statd rpc.lockd rpc.quotad (optional)
- Test the new server by unmounting and remounting something
on a client. On the client, typing 'mount' should print a
line like:
dalek:/temporary on /temporary type nfs (rw,addr=192.168.100.2)
Checklist - if it won't start
NFS is difficult to debug because it often writes nothing to any log file. It may not even be obvious whether it is running or not.
- Make sure /etc/exports exists and is readable:
ls -l /etc/exports -rw-r--r-- 1 root root 177 Aug 7 2001 /etc/exports cat /etc/exports /home/shared_stuff *.my_hostname.com(rw)
- Make sure the executables are running on server:
ps -aux | grep rpc root 793 0.0 0.6 1768 824 ? S 17:06 0:00 /usr/sbin/rpc.mountd root 798 0.0 0.6 1772 804 ? S 17:06 0:00 /usr/sbin/rpc.nfsd ps -aux | grep nfs root 798 0.0 0.6 1772 804 ? S 17:06 0:00 /usr/sbin/rpc.nfsd ps -aux | grep portmap bin 389 0.0 0.4 1340 540 ? S 17:06 0:00 /sbin/portmap
- Check the rpc diagnostic tools on server for clues
/usr/sbin/rpcinfo -p localhost program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100005 1 udp 969 mountd 100005 2 udp 969 mountd 100005 1 tcp 972 mountd 100005 2 tcp 972 mountd 100003 2 udp 2049 nfs 100003 2 tcp 2049 nfs /usr/sbin/showmount Hosts on my_samba_server: host1.my_hostname.com host2.my_hostname.com /usr/sbin/nfsstat Warning: /proc/net/rpc/nfsd: No such file or directory Server rpc stats: calls badcalls badauth badclnt xdrcall 0 0 0 0 0 Server nfs v2: null getattr setattr root lookup readlink 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% read wrcache write create remove rename 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% [etc] Client rpc stats: [etc] Client nfs v3: [etc]
- Try rebooting. Sometimes the NFS server will only start at boot-up.
- Make sure NFS server is activated in kernel. This may require compiling
a new kernel. The following need to be activated in /usr/src/linux/.config:
(This is for kernel 2.5.5).# CONFIG_CODA_FS is not set # CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFSD=y CONFIG_NFSD_V3=y CONFIG_SUNRPC=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y
- As a last resort, if the daemon starts up, get its pid using 'ps'
and try strace to find out what it's doing:
# strace -f -p < pid> 2>&1 | tee /tmp/junk
Error messages
nfssvc: Function not implemented |
If the server gets a message like:
carbon portmap[7989]: connect from 192.168.100.2 to dump(): request from unauthorized host |
In hosts.allow:
ALL : 192.168.100.2 |
/home/tjnelson 192.168.100.2(rw) |
Cannot MOUNTPROG RPC: RPC: Program not registered |
Back