Tuesday, 12 March 2013

More fun with NFS on Red Hat Enterprise Linux

Hot on the heels of my last post: -

Seeing "mount clntudp_create: RPC: Program not registered" when starting NFS on Red Hat Enterprise Linux 

I hit another apparent show-stopper with NFS.

In fact, I hit two problems.

In the first instance, I was seeing: -

$ mount /mnt

mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

I spent nearly an hour trying to debug this, until inspiration ( and, perhaps, a spot of Google helped ).

Guess what ?

There were bloomin' firewalls running on the two boxes - client and server.

I quickly killed them off: -

$ service iptables stop

iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]

and I then hit my second problem: -

$ mount /mnt

mount.nfs: mounting failed, reason given by server:
  No such file or directory

I re-checked /etc/exports on the NFS server, which read: -

/media/Software *(rw,no_root_squash)

but I was also seeing: -

Mar 12 18:07:47 vhost4288 mountd[26662]: can't stat exported dir /media/Software: No such file or directory

in it's own logs - /var/log/messages.

I then looked again at the actual directory itself: -

$ ls -al /media

only to find that the directory had been miskeyed as: -

total 16
drwxr-xr-x  2 root root 4096 Mar 12 12:26 .
drwxr-xr-x 28 root root 4096 Mar 12 12:26 ..
-rw-r--r--  1 root root    0 Mar 12 12:26 .hal-mtab
lrwxrwxrwx  1 root root   15 Dec 10 08:41 Sotfware -> /data/Software/

Can you spot the obvious error ?

Yep, someone had misspelt Software as Sotfware.

In the end, I just changed /etc/exports to: -

/data/Software *(rw,no_root_squash)

and re-ran my mount command: -

$ mount /mnt

Can you say "Doh!" ? I bet you can ….

No comments: