Solved

NFS Mounting not working

Posted on 2006-12-01
8
296 Views
Last Modified: 2012-06-27
I am attempting to mount a directory from (1)Linux FC4 to another (2)Linux FC4 exact hardware and configuration's, one has massive drive space all files need to be stored on server (1) and accessed from Server (2) eventually there will be a server (3) and (4) added to the mix. When trying to mount the connection, it eventually times out.

I have added portmap: 192.168.1.1/255.255.255.0 to the hosts.allow file.

I have looked in the logs for possible clues but no luck.

If anyone can assist would be greatly appreciated.

Thanks
0
Comment
Question by:digitalpacman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 18058610
On the server, you need to add the client mounts to /etc/exports: see "man exportfs"
If the server has not been used to serve nfs before, you may need to start some services manually: nfs, mountd, portmap & lockd IIRC. Service names may be preceded by "rpc." e.g. rpc.mountd on my system. These services will probably start by themselves next reboot - they do on Slackware (the scripts check for non_comment entries in /etc/exports).
I don't think hosts.allow comes into it - thought that was for ftp.
Client systems should run portmap also.
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 18058622
If it still doesn't work, checvk logs in /var/log - there will usually be something there.
0
 
LVL 15

Expert Comment

by:DonConsolio
ID: 18059347
on ALL involved machines
- start portmapper
- update your /etc/hosts to contain a list of all machines
- try disabling firewalls if possible and re-enable if everything works
- check hosts.allow and hosts.deny files
- test connectivity with "ping  hostname", then with "rpcinfo -p hostname"

on Server(s)
- add desired directory to etc/exports
- start nfs server

on client
- mount directory
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:digitalpacman
ID: 18060821
I did all the steps as described and ran rpcinfo -p hostname this did nothing, I am not able to start NFS it says command not found. How can I tell if NFS is installed, also mountd command was not found.
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 18061271
Working back from the end of your post:
"locate mountd" will tell you where it is if it's installed at all, and also what it's called. On my system, you would start it manually be typing "/usr/sbin/rpc.mountd".
To find out whether NFS is installed, you need first of all to discover how it's configured in the kernel, as in this example:-

10:16:11$ gzip -cd /proc/config.gz |grep -i nfs
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
# CONFIG_NFSD_V4 is not set
# CONFIG_NFSD_TCP is not set
CONFIG_NFS_COMMON=y

This assumes your kernel was configured to have its config available in /proc, but most distros do that nowadays.

/proc/config.gz is an actual test image of the .config file used to build your kernel. When building a kernel, all variants of "make config" produce this file eventually.
The lines starting "#" are comments so you can ignore them. Lines ending "=m" mean the facility is configured as a module. Lines ending "=y" mean the facility is configured built in to the kernel.
So you can see my kernel supports nfsd as a module. The command to load the module happens to be "modprobe nfsd" - .config doesn't actually tell you that though. Also my system supports NFS-mounted filesystems if the module is loaded: on my system it isn't right now:

10:23:59$ cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   sockfs
nodev   pipefs
nodev   futexfs
nodev   tmpfs
nodev   inotifyfs
nodev   eventpollfs
nodev   devpts
        ext3
        ext2
nodev   ramfs
nodev   mqueue
        vfat
nodev   rpc_pipefs
nodev   nfsd
        iso9660

but I can force it on:

10:13:25# modprobe nfs

10:28:21$ cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   sockfs
nodev   pipefs
nodev   futexfs
nodev   tmpfs
nodev   inotifyfs
nodev   eventpollfs
nodev   devpts
        ext3
        ext2
nodev   ramfs
nodev   mqueue
        vfat
nodev   rpc_pipefs
nodev   nfsd
        iso9660
nodev   nfs

How did I know the module name? Actually I had to look it up:

10:27:01$ find /lib/modules/2.6.15_1_64/ -name '*nfs*'
/lib/modules/2.6.15_1_64/kernel/fs/nfs
/lib/modules/2.6.15_1_64/kernel/fs/nfs/nfs.ko
/lib/modules/2.6.15_1_64/kernel/fs/nfsd
/lib/modules/2.6.15_1_64/kernel/fs/nfsd/nfsd.ko

Of course the kernel name on your system will be different.

The command to start the NFS daemon on my system is "/usr/sbin/rpc.nfsd". To start lockd "/usr/sbin/rpc.lockd". To find programs when you're unsure of the name & location (e.g. nfsd), enter a command something like:

10:35:15$ locate nfs|grep bin|grep -vw src
/usr/sbin/rpc.nfsd
/usr/sbin/nfsstat

Just "rpcinfo -p" should produce output:

10:39:08$ rpcinfo -p
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp  32770  nlockmgr
    100021    3   udp  32770  nlockmgr
    100021    4   udp  32770  nlockmgr
    100005    1   udp    781  mountd
    100005    1   tcp    784  mountd
    100005    2   udp    781  mountd
    100005    2   tcp    784  mountd
    100005    3   udp    781  mountd
    100005    3   tcp    784  mountd
    100024    1   udp    790  status
    100024    1   tcp    793  status

Did exportfs work OK for you? If so you should now get some output from it:

10:40:32$ exportfs
/boot           darkstar.local.net
/sda2           darkstar.local.net
/boot           dullstar.local.net
/sda2           dullstar.local.net

This is a table of local mount points vs the systems they are allowed to be exported to.

Hope that's enough to get you going - you'll want to turn on NFS at boot time in future of course - read "man chkconfig" for info on that.
0
 

Author Comment

by:digitalpacman
ID: 18061632
Here are the results of what I found I am still not able to run mountd and exportfs returns no results hopefully this will help as I am not able to mount the directory as desired.

locate mountd
/usr/libexec/webmin/exports/restart_mountd.cgi
/etc/log.d/scripts/services/mountd
/etc/log.d/conf/services/mountd.conf

/usr/sbin/rpc.mountd
-bash: /usr/sbin/rpc.mountd: No such file or directory

gzip -cd /proc/config.gz |grep -i nfs
gzip: /proc/config.gz: No such file or directory

cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   sockfs
nodev   binfmt_misc
nodev   usbfs
nodev   usbdevfs
nodev   futexfs
nodev   tmpfs
nodev   pipefs
nodev   eventpollfs
nodev   devpts
        ext2
nodev   ramfs
nodev   hugetlbfs
        iso9660
nodev   relayfs
nodev   mqueue
        ext3
nodev   rpc_pipefs
nodev   nfs
nodev   nfs4
nodev   nfsd

find /lib/modules/2.6.9-42.0.3.EL/ -name '*nfs*'
/lib/modules/2.6.9-42.0.3.EL/kernel/fs/nfs_common/nfs_acl.ko
/lib/modules/2.6.9-42.0.3.EL/kernel/fs/nfs
/lib/modules/2.6.9-42.0.3.EL/kernel/fs/nfs/nfs.ko
/lib/modules/2.6.9-42.0.3.EL/kernel/fs/nfsd
/lib/modules/2.6.9-42.0.3.EL/kernel/fs/nfsd/nfsd.ko

locate nfs|grep bin|grep -vw src
does nothing

rpcinfo -p
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    390113    1   tcp   7937

exportfs
-bash: exportfs: command not found
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 18062407
It seems you don't have the necessary commands installed to serve NFS although your kernel is configured to do it.

You need to install them - can you see alikely RPM on your distro CD?
0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 18062949
On my FC2 disc set, it was on CD #1 and called nfs-utils-1.0.6-20.x86_64.rpm. So I guess yours will have a name starting "nfs-utils-".
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question