Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-13-2011, 12:34 PM
|
#1
|
LQ Newbie
Registered: Feb 2008
Posts: 12
Rep:
|
fstab best practices with NFS
OK, On a production server, I want an NFS share to mount automatically. What is the best practice to use?
Code:
192.168.2.2:/archive01 /mnt/fileserver nfs rw,hard,intr 0 0
Or
Code:
fileserver:/archive01 /mnt/fileserver nfs rw,hard,intr 0 0
My understanding is that it is always best practice to use IP addresses in the fstab because the server will fail to mount the share upon booting if DNS is unavailable. I've also been told that if one MUST use names in the fstab, there should be a hosts file entry for it so that the server doesn't depend on DNS on boot.
So, what is the most appropriate best practice?
|
|
|
04-13-2011, 01:15 PM
|
#2
|
Member
Registered: Aug 2009
Location: /Universe/Earth/India/Pune
Distribution: Slackware64 -Current
Posts: 890
Rep:
|
Hi,
Seems like you already know which is the industry standard, i.e. using IP address in the fstab.
On my client's production servers it's the IP addresses that are being used and the reason you have already mentioned.
Regards.
|
|
|
04-13-2011, 02:16 PM
|
#3
|
Member
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375
Rep:
|
Actually, this is why you have redundant DNS servers, so that if one DNS server is down, you can use the next, and so on. If all of your DNS servers are unavailable, you probably have bigger issues.
Unless that IP address is a virtual IP used by a clustering solution, or front-ended by a load balancer, you've just given yourself a single point of failure. Also, if you need to re-assign the address to the file server for whatever reason, now you've got to change configurations in a hundred different places, instead of making the change just once in DNS, so you've raised the risk of outages for this otherwise simple configuration change significantly. Depending on your disaster recovery and DR-testing plans, you may have made those more difficult as well.
And I'd have to defer to their superior knowledge on this, but my security department quashed the idea of us using NFS due to security concerns. They were much happier with SMB.
So, without knowing the intimate details of your shop (big/med/small business, SLAs, etc.), I'd say this implementation is the opposite of industry standards.
|
|
|
04-13-2011, 02:30 PM
|
#4
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
For servers, one could include them in /etc/hosts and for some servers some people even include their entries in /etc/ethers, and load their mac addresses to help prevent arp spoofing on the LAN. The later would be most helpful for name servers and gateways to help prevent arp spoofing.
|
|
|
04-14-2011, 04:24 PM
|
#5
|
Member
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59
Rep:
|
- I agree with SL00b: Using IP addresses makes a future address change a nightmare; I think it's better to use hostnames and let the redundant DNS system do the resolving.
- I like to use a timeo on NFS mounts; otherwise, if the NFS servers hangs, the client might too.
|
|
|
04-15-2011, 09:37 AM
|
#6
|
LQ Newbie
Registered: Jan 2008
Posts: 12
Rep:
|
Noted Sl00b's correct comment on NFS (un)safety, but I don't care too much on my home network.
@amonamarth: can you explain 'timeo' to me? Is it a NFS option which I could add to fstab? If so, it might solve a NFS mount at boot time problem I'm struggling with.
|
|
|
04-15-2011, 06:34 PM
|
#7
|
Member
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59
Rep:
|
That is a mount option on the client's side, I also use "soft mount" in conjunction with timeouts.
If the NFS server goes down, if you do a hard mount, the client will hang, sometimes requiring a reboot; whereas, if you use a soft mount with a timeout, the client will eventually "time out" and the file system simply gets unmounted.
For example, on the client's /etc/fstab:
nfs_server:/some/directory /mnt/nfs nfs defaults,timeo=14,soft 0 0
From nfs man page:
timeo=n
The value in tenths of a second before sending the first retransmission after an RPC timeout.
The default value is 7 tenths of a second. After the first timeout, the timeout is doubled
after each successive timeout until a maximum timeout of 60 seconds is reached or the enough
retransmissions have occured to cause a major timeout.
soft
If an NFS file operation has a major timeout then report an I/O error to the calling
program. The default is to continue retrying NFS file operations indefinitely.
|
|
|
04-17-2011, 03:54 PM
|
#8
|
LQ Newbie
Registered: Jan 2008
Posts: 12
Rep:
|
nfs continued
@amonamarth Thanks for the RTM. Indeed I had overlooked the 'timeo=' option. (Probably reminded me of 'timeo Danaos et dona ferentis'...)
Meanwhile I've tried the 'soft', 'intr' and 'timeo=' options in various combinations, but they either didn't change the long time for mounting NFS shares, or returned error messages about rpc.statd not running or nolock/lock issues. Finally, after studying this Linux NFS-HowTo on Sourceforge.net, I concluded to mount with 'nosuid,hard,intr'. It's still slow, but works well.
Arguments:
- 'nosuid' keeps the client safer from the server
- 'hard' avoids data loss
- 'intr' should interrupt in case of hanging client/server communication
Still thanks for your comments -- they made me search better.
Last edited by martje; 04-17-2011 at 03:56 PM.
|
|
|
All times are GMT -5. The time now is 08:48 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|