[quote]
pschaff wrote:
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.[/quote]
Thank you, that worked. I added
[code]
mount.nfs david.example.com:/shares /mnt/nfs
[/code]
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.
Mounting an NFS directory in /etc/fstab
Re: Mounting an NFS directory in /etc/fstab
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.
Re: Mounting an NFS directory in /etc/fstab
[quote]
TrevorH wrote:
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.[/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.
TrevorH wrote:
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.[/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.
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: Mounting an NFS directory in /etc/fstab
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.
Re: Mounting an NFS directory in /etc/fstab
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 [i]service[/i] that a fully
operational system provides to the other machines on the network.
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 [i]service[/i] that a fully
operational system provides to the other machines on the network.
Re: Mounting an NFS directory in /etc/fstab
[quote]
pschaff wrote:
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.[/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.
pschaff wrote:
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.[/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.
Re: Mounting an NFS directory in /etc/fstab
Yes, the renaming of the startup scripts is only necessary when you use the same system as nfs client and server at the same time. In normal use it wouldn't be required. Virtualisation is the real solution to your problem.