www.centos.org Forum Index CentOS 6 - Software Support Mounting an NFS directory in /etc/fstab
|
Bottom Previous Topic Next Topic |
| |
|
|
|---|
| Poster | Thread | Rated: 1 Votes |
|---|
|
Re: Mounting an NFS directory in /etc/fstab | #15 |
|
|---|---|---|---|
|
Regular Board Member
![]()
Joined: 2011/11/21
From
Posts: 66
|
Quote:
So if I shared a directory using NFS in /etc/exports and I used a different computer as a client then it would not be necessary to rename the startup scripts on the client?. In the RHCSA exam it will be possible to use virtualization to simulate a real client/server network on a single computer so I should start practicing on a computer that is capable of virtualization to get more realistic experience before I take the test. |
||
Posted on: 2011/12/4 21:45
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #14 |
|
|---|---|---|---|
|
Professional Board Member
![]()
Joined: 2007/12/11
From Finland
Posts: 1329
|
I think that the logic for startup order is clear.
Mounting foreign filesystems is probably initialization of important resources to the use of the system. That can be important and needed early on. There are even diskless clients that definitely depend on mounting first. NFS server on the other hand is a mere service that a fully operational system provides to the other machines on the network. |
||
Posted on: 2011/12/4 20:51
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #13 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
Using the same system as the server and client for NFS is quite unusual, and one might argue of doubtful value in the real world. I doubt it is a situation that would come up on the RHCSA exam, nor one that would be considered by Red Hat when determining the order in which to start services.
|
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2011/12/4 19:47
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #12 |
|
|---|---|---|---|
|
Regular Board Member
![]()
Joined: 2011/11/21
From
Posts: 66
|
Quote:
In CentOS 6, /etc/rc3.d and /etc/rc5.d both contain S24nfslock, S25netfs and S30nfs. Why would Red Hat put these startup scripts in the wrong order?. This is such an obvious problem that I cannot believe it was done by accident. I experimented with this by renaming S25netfs to S32netfs and I commented the mount.nfs4 commands that I had put in /etc/rc.d/rc.local and I uncommented the mount the nfs entries in /etc/fstab. It worked. I am glad that I learned about this problem now so I will know how to fix it when I take the RHCSA exam. |
||
Posted on: 2011/12/4 19:11
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #11 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6365
|
I do remember doing this a few years ago and I had to amend the order of some of the start-up scripts. Looking at my CentOS 5 box which is the only one I use as an NFS server, in /etc/rc3.d I see that I have S25netfs and S60nfs which means that it will attempt to mount the NFS file systems before it has started the NFS daemons. The solution was to rename the start up script so that netfs ran after nfs.
|
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2011/12/4 0:38
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #10 |
|
|---|---|---|---|
|
Regular Board Member
![]()
Joined: 2011/11/21
From
Posts: 66
|
Quote:
Thank you, that worked. I added to /etc/rc.d/rc.local and it worked. I am curious to know if it is theoretically possible to use NFS to mount a directory that is on the local host at boot using /etc/fstab. It is not important because it is the results that count. |
||
Posted on: 2011/12/4 0:30
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #9 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
Not a very realistic environment but I guess one has to make do with available resources. You could add the mount command in /etc/rc.d/rc.local that runs at the end of the boot.
|
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2011/12/3 21:52
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #8 |
|
|---|---|---|---|
|
Regular Board Member
![]()
Joined: 2011/11/21
From
Posts: 66
|
Quote:
No, I said it still does not work. I am just practicing for the RHCSA exam so my computer is both the server and the client. Entering mount -a works, so I do not understand why these directories are not mounting at boot. I do not think DNS was ever the problem because I resolved my IP address to david.example.com in /etc/hosts and I can ping david.example.com. |
||
Posted on: 2011/12/3 21:41
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #7 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
Are you saying that solved the problem? If so, you have a DNS issue.
The /etc/exports file is used on the NFS server and not on the client. |
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2011/12/3 21:33
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #6 |
|
|---|---|---|---|
|
Regular Board Member
![]()
Joined: 2011/11/21
From
Posts: 66
|
I tried all of your suggestions and it still does not work. I edited /etc/exports and added
I edited /etc/fstab and added |
||
Posted on: 2011/12/3 21:24
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #5 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
|
What happens if you omit the timeo or udp options?
|
||
|
_________________
Phil Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions |
|||
Posted on: 2011/12/3 20:52
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #4 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2009/9/24
From Brighton, UK
Posts: 6365
|
Include the "_netdev" option in the list of options. This tells the init scripts that the file system to be mounted resides on a network device and needs the network to be available before it can be mounted.
|
||
|
_________________
Linux/VoIP Systems Administrator |
|||
Posted on: 2011/12/3 19:20
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #3 |
|
|---|---|---|---|
|
Moderator
![]()
Joined: 2006/9/3
From California, US
Posts: 6921
|
Just for testing purpose, can you use the IP address in /etc/fstab and see if it still fails to mount upon booting?
|
||
Posted on: 2011/12/3 19:05
|
|||
|
Re: Mounting an NFS directory in /etc/fstab | #2 |
|
|---|---|---|---|
|
Regular Board Member
![]()
Joined: 2011/11/21
From
Posts: 66
|
chkconfig nfs on was activated before I started this thread.
|
||
Posted on: 2011/12/3 16:47
|
|||
|
Mounting an NFS directory in /etc/fstab | #1 |
|
|---|---|---|---|
|
Regular Board Member
![]()
Joined: 2011/11/21
From
Posts: 66
|
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 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 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 code tags to aid legibility.] |
||
Posted on: 2011/12/2 21:04
|
|||
Top Previous Topic Next Topic |
|



Topic options
Print Topic
Threaded
Oldest First
1 Votes
TrevorH





You cannot start a new topic.
You can view topic.