Mounting an NFS directory in /etc/fstab
Posted: 2011/12/02 21:04:10
I am studying for the RHCSA exam and I am trying to mount an NFS directory at boot.
I resolved my ip address to david.example.com in /etc/hosts and I entered /shares *.example.com(rw,sync) in /etc/exports and entered exportfs -a. I entered
[code]
david.example.com:/shares /mnt/nfs nfs rsize=8192,wsize=8192,timeo=14,intr,udp 0 0
[/code]
in /etc/fstab.
When I restart it takes longer than normal to boot up and when I check the boot messages it says mount.nfs connection timed out. When I enter mount -a it does mount /shares on /mnt/nfs.
I tried editing /etc/sysconfig/iptables and I added
[code]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
[/code]
I did service iptables restart and it restarted without any problems but when I restart I still have the same problem.
Does anyone have any suggestions?.
[Moderator edited to insert [i]code[/i] tags to aid legibility.]
I resolved my ip address to david.example.com in /etc/hosts and I entered /shares *.example.com(rw,sync) in /etc/exports and entered exportfs -a. I entered
[code]
david.example.com:/shares /mnt/nfs nfs rsize=8192,wsize=8192,timeo=14,intr,udp 0 0
[/code]
in /etc/fstab.
When I restart it takes longer than normal to boot up and when I check the boot messages it says mount.nfs connection timed out. When I enter mount -a it does mount /shares on /mnt/nfs.
I tried editing /etc/sysconfig/iptables and I added
[code]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
[/code]
I did service iptables restart and it restarted without any problems but when I restart I still have the same problem.
Does anyone have any suggestions?.
[Moderator edited to insert [i]code[/i] tags to aid legibility.]