LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-13-2011, 12:34 PM   #1
bbennett
LQ Newbie
 
Registered: Feb 2008
Posts: 12

Rep: Reputation: 0
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?
 
Old 04-13-2011, 01:15 PM   #2
PrinceCruise
Member
 
Registered: Aug 2009
Location: /Universe/Earth/India/Pune
Distribution: Slackware64 -Current
Posts: 890

Rep: Reputation: 186Reputation: 186
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.
 
Old 04-13-2011, 02:16 PM   #3
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
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.
 
Old 04-13-2011, 02:30 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 04-14-2011, 04:24 PM   #5
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59

Rep: Reputation: 17
- 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.
 
Old 04-15-2011, 09:37 AM   #6
martje
LQ Newbie
 
Registered: Jan 2008
Posts: 12

Rep: Reputation: 0
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.
 
Old 04-15-2011, 06:34 PM   #7
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59

Rep: Reputation: 17
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.
 
Old 04-17-2011, 03:54 PM   #8
martje
LQ Newbie
 
Registered: Jan 2008
Posts: 12

Rep: Reputation: 0
Smile 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
NFS share : fstab njb Linux - Newbie 1 07-28-2010 08:34 AM
NFS mounting using FSTAB Ammad Linux - Networking 7 12-18-2008 07:23 AM
NFS automount using fstab priyarao Linux - Newbie 1 08-05-2008 11:13 AM
Fstab does not work in nfs windsurfer Linux - Software 1 04-23-2007 03:33 AM
how do I mount with nfs in fstab? Falafel Linux - Networking 1 11-13-2003 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:48 PM.

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