LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-12-2012, 01:48 PM   #1
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Rep: Reputation: 15
Can't nfs mount from Fedora 16 NFS server.


Hi All,

I am running F16. I have setup /etc/exports and installed and started all NFS server services:

[root@master ~]#
systemctl start rpcbind.service

[root@master ~]#
systemctl start nfs-server.service

[root@master ~]#
systemctl start nfs-lock.service

[root@master ~]#
systemctl start nfs-idmap.service

[root@master ~]#
systemctl enable rpcbind.service

[root@master ~]#
systemctl enable nfs-server.service

[root@master ~]#
systemctl enable nfs-lock.service

[root@master ~]#
systemctl enable nfs-idmap.service


But I am not able to mount from another machine (RHEL):

[root@localhost ~]# mount -t nfs 10.10.2.185:/home/lid2/workspace /mnt
mount.nfs: access denied by server while mounting 10.10.2.185:/home/lid2/workspace


I turn on the /var/log/messages on 10.10.2.185 but can't see any requests though I can ping the IP address.

Any idea how I can debug this issue?

Thanks.
 
Old 03-12-2012, 02:01 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi wdli,

So you are trying to mount NFS share that you have configured on F16 machine on RHEL machine. Is that right? If yes, did you check if your RHEL machine is able to telnet Fedora 16 machine on port 2049. If not then there could be 2 reasons:

1. Services on F16 machines are not running. But you said that they are running then lets move on to next;
2. Firewall is blocking the traffic on port 2049.

Did you try disabling firewall on F16 and see if you are able to mount NFS share? Remember that F16 does not use iptables it use firewalld instead. So if you want to turn off firewall in F16 you have to use the following command:

Code:
system-config-firewall
 
Old 03-12-2012, 04:38 PM   #3
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by T3RM1NVT0R View Post
Hi wdli,

So you are trying to mount NFS share that you have configured on F16 machine on RHEL machine. Is that right? If yes, did you check if your RHEL machine is able to telnet Fedora 16 machine on port 2049. If not then there could be 2 reasons:

1. Services on F16 machines are not running. But you said that they are running then lets move on to next;
2. Firewall is blocking the traffic on port 2049.

Did you try disabling firewall on F16 and see if you are able to mount NFS share? Remember that F16 does not use iptables it use firewalld instead. So if you want to turn off firewall in F16 you have to use the following command:

Code:
system-config-firewall
Hi,

I disabled the iptables (systemctl stop iptables.service) and firewalld (in system-config-firewall) but still couldn't mount. Telnet to port 2049 also failed. I did fair amount googling but didn't find anything useful. Strangely this only happnes to F16. It's ok if I mount from another RHEL5.4. Any more thoughts?
 
Old 03-12-2012, 04:42 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Are you trying to mount NFS share running on RHEL box to F16 or you are trying to mount export configured on F16 to RHEL box. Below statement from you sounds confusing:

Quote:
Strangely this only happnes to F16. It's ok if I mount from another RHEL5.4. Any more thoughts?
When you said telnet failed what was the message that you got? Did you check selinux status on machine? Is selinux enabled and running in targeted mode. You can check selinux status using the following command:

Code:
sestatus
 
Old 03-12-2012, 04:47 PM   #5
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by T3RM1NVT0R View Post
Are you trying to mount NFS share running on RHEL box to F16 or you are trying to mount export configured on F16 to RHEL box. Below statement from you sounds confusing:



When you said telnet failed what was the message that you got? Did you check selinux status on machine? Is selinux enabled and running in targeted mode. You can check selinux status using the following command:

Code:
sestatus
sorry, exported NFS dirs are on the FC16 andon RHEL5.4 too. In other words, both FC16 and RHEL 5.4 are running NFS servers. The client is another RHEL5.4 machine which mounts ok from the NFS server on RHEL5.4 but not on FC16.

on FC16, yes SELinux seems to be enabled:

SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 26
Policy from config file: targeted
 
Old 03-12-2012, 04:50 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Run the following command on F16 and paste the output:

Code:
getsebool -a | grep nfs
You didn't tell what was the message that you get when you try to telnet.
 
Old 03-12-2012, 04:50 PM   #7
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by T3RM1NVT0R View Post
Are you trying to mount NFS share running on RHEL box to F16 or you are trying to mount export configured on F16 to RHEL box. Below statement from you sounds confusing:



When you said telnet failed what was the message that you got? Did you check selinux status on machine? Is selinux enabled and running in targeted mode. You can check selinux status using the following command:

Code:
sestatus
Forgot: telnet didn't return, just hung.
 
Old 03-12-2012, 04:52 PM   #8
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by T3RM1NVT0R View Post
Run the following command on F16 and paste the output:

Code:
getsebool -a | grep nfs
You didn't tell what was the message that you get when you try to telnet.
[lid2@fc16-lid sysconfig]$ getsebool -a | grep nfs
allow_ftpd_use_nfs --> off
allow_nfsd_anon_write --> off
cobbler_use_nfs --> off
git_system_use_nfs --> off
httpd_use_nfs --> off
nfs_export_all_ro --> on
nfs_export_all_rw --> on
polipo_use_nfs --> off
qemu_use_nfs --> on
samba_share_nfs --> off
sanlock_use_nfs --> off
use_nfs_home_dirs --> off
virt_use_nfs --> on
xen_use_nfs --> off
[lid2@fc16-lid sysconfig]$
 
Old 03-12-2012, 04:56 PM   #9
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

selinux booleans for nfs looks ok. Run the following command on F16 and paste the output:

Code:
cat /etc/exports
Check once again that your firewall on F16 is turned off and nfs services are running on F16 machine.
 
Old 03-12-2012, 05:00 PM   #10
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by T3RM1NVT0R View Post
selinux booleans for nfs looks ok. Run the following command on F16 and paste the output:

Code:
cat /etc/exports
Check once again that your firewall on F16 is turned off and nfs services are running on F16 machine.
[lid2@fc16-lid sysconfig]$ cat /etc/exports
/home/lid2/workspace *(rw)
 
Old 03-12-2012, 05:08 PM   #11
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Alright.

Run the following command on client machine (RHEL machine):

Code:
showmount -e <ip address of F16 machine>
If you are not able to see nfs share then there is something blocking it. If you are able to see nfs share then run the mount command as follows:

mount -t nfs -o 'vers=3' -v 10.10.2.185:/home/lid2/workspace /mnt[/code]

Paste the output of the above command here if it still doesn't mount.
 
Old 03-12-2012, 05:31 PM   #12
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by T3RM1NVT0R View Post
Alright.

Run the following command on client machine (RHEL machine):

Code:
showmount -e <ip address of F16 machine>
If you are not able to see nfs share then there is something blocking it. If you are able to see nfs share then run the mount command as follows:

mount -t nfs -o 'vers=3' -v 10.10.2.185:/home/lid2/workspace /mnt[/code]

Paste the output of the above command here if it still doesn't mount.

--------------------

First, thanks for being patient with me.

On the client (RHEL machine):
-----------------------------
Apparently the client is able to see the exported share:

Quote:
[lid@lid-linux workspace]$ showmount -e 10.10.2.185
Export list for 10.10.2.185:
/home/lid2/workspace *
So I went ahead to mount it:

Code:
[lid@lid-linux workspace]$ sudo mount -t nfs -o 'vers=3' -v 10.10.2.185:/home/lid2/workspace ./workspace_fc16_mnt/
mount.nfs: timeout set for Mon Mar 12 15:30:30 2012
mount.nfs: trying text-based options 'vers=3,addr=10.10.2.185'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.10.2.185 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 10.10.2.185 prog 100005 vers 3 prot UDP port 20048
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 10.10.2.185:/home/lid2/workspace
On the server (F16)
---------------------
Code:
/var/log/messages:
Mar 12 15:23:41 fc16-lid rpc.mountd[878]: refused mount request from 10.10.16.12 for /home/lid2/workspace (/): no export entry
So I thought this is strange and dumped the exported dir:

Code:
[lid2@fc16-lid ~]$ sudo exportfs
/home/lid2/workspace
		<world>
So who is blocking this on the F16?
 
Old 03-12-2012, 05:42 PM   #13
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

You're welcome

Paste the output of:

Code:
cat /etc/nfsmount.conf
If the above file does not exist (or even exist) continue with the following:

1. Restart F16 machine
2. Make sure that nfs services start at the time of boot.
3. Make sure that firewall is down.

Run the same mount command which I mentioned in my previous post and let me know the result.
 
Old 03-12-2012, 06:11 PM   #14
wdli
Member
 
Registered: Sep 2008
Location: California
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by T3RM1NVT0R View Post
You're welcome

Paste the output of:

Code:
cat /etc/nfsmount.conf
If the above file does not exist (or even exist) continue with the following:

1. Restart F16 machine
2. Make sure that nfs services start at the time of boot.
3. Make sure that firewall is down.

Run the same mount command which I mentioned in my previous post and let me know the result.
This is the output from the NFS client (RHEL5.4):

Quote:
#
# /etc/nfsmount.conf - see nfsmount.conf(5) for details
#
# This is an NFS mount configuration file. This file can be broken
# up into three different sections: Mount, Server and Global
#
# [ MountPoint "Mount_point" ]
# This section defines all the mount options that
# should be used on a particular mount point. The '<Mount_Point>'
# string need to be an exact match of the path in the mount
# command. Example:
# [ MountPoint "/export/home" ]
# background=True
# Would cause all mount to /export/home would be done in
# the background
#
# [ Server "Server_Name" ]
# This section defines all the mount options that
# should be used on mounts to a particular NFS server.
# Example:
# [ Server "nfsserver.foo.com" ]
# rsize=32k
# wsize=32k
# All reads and writes to the 'nfsserver.foo.com' server
# will be done with 32k (32768 bytes) block sizes.
#
[ NFSMount_Global_Options ]
# This statically named section defines global mount
# options that can be applied on all NFS mount.
#
# Protocol Version [2,3,4]
# This defines the default protocol version which will
# be used to start the negotiation with the server.
# Defaultvers=4
#
# Setting this option makes it mandatory the server supports the
# given version. The mount will fail if the given version is
# not support by the server.
# Nfsvers=4
#
# Network Protocol [udp,tcp,rdma] (Note: values are case sensitive)
# This defines the default network protocol which will
# be used to start the negotiation with the server.
# Defaultproto=tcp
#
# Setting this option makes it mandatory the server supports the
# given network protocol. The mount will fail if the given network
# protocol is not supported by the server.
# Proto=tcp
#
# The number of times a request will be retired before
# generating a timeout
# Retrans=2
#
# The number of minutes that will retry mount
# Retry=2
#
# The minimum time (in seconds) file attributes are cached
# acregmin=30
#
# The Maximum time (in seconds) file attributes are cached
# acregmin=60
#
# The minimum time (in seconds) directory attributes are cached
# acregmin=30
#
# The Maximum time (in seconds) directory attributes are cached
# acregmin=60
#
# Enable Access Control Lists
# Acl=False
#
# Enable Attribute Caching
# Ac=True
#
# Do mounts in background (i.e. asynchronously)
# Background=False
#
# Close-To-Open cache coherence
# Cto=True
#
# Do mounts in foreground (i.e. synchronously)
# Foreground=True
#
# How to handle times out from servers (Hard is STRONGLY suggested)
# Hard=True
# Soft=False
#
# Enable File Locking
# Lock=True
#
# Enable READDIRPLUS on NFS version 3 mounts
# Rdirplus=True
#
# Maximum Read Size (in Bytes)
# Rsize=8k
#
# Maximum Write Size (in Bytes)
# Wsize=8k
#
# Maximum Server Block Size (in Bytes)
# Bsize=8k
#
# Ignore unknown mount options
# Sloppy=False
#
# Share Data and Attribute Caches
# Sharecache=True
#
# The amount of time, in tenths of a seconds, the client
# will wait for a response from the server before retransmitting
# the request.
# Timeo=600
#
# Sets all attributes times to the same time (in seconds)
# actimeo=30
#
# Server Mountd port mountport
# mountport=4001
#
# Server Mountd Protocol
# mountproto=tcp
#
# Server Mountd Version
# mounvers=3
#
# Server Mountd Host
# mounthost=hostname
#
# Server Port
# Port=2049
#
# RPCGSS security flavors
# [none, sys, krb5, krb5i, krb5p ]
# Sec=sys
 
Old 03-12-2012, 06:17 PM   #15
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

I need /etc/nfsmount.conf from F16 machine.

Did you perform the other things that I have suggested?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to mount a nfs mount from linux client to AIX nfs server dennyqian AIX 13 04-11-2016 11:30 PM
[SOLVED] NFS mount fails (times out): NFS server is in DMZ, NFS client is in intranet Hiroshi Linux - Networking 2 05-24-2010 10:22 AM
[SOLVED] mount.nfs: mount to NFS server 'rpcbind' failed w1k0 Slackware 4 03-30-2010 03:45 PM
mount.nfs: mount to NFS server 'jesse' failed: timed out, retrying keupie Linux - Networking 3 06-05-2009 07:03 PM
NFS mount mount.nfs: access denied by server while mounting knockout_artist Linux - Newbie 2 11-26-2008 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 07:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration