Linux: difference between using autofs with NFS and just using fstab
With fstab
, the advantage is the remote filesystem will be mounted on system (when the noauto
mount option is not used).
Additionally, it depends how the mount point is defined. There are two options which determines the recovery behaviour when the NFS client can't reach the server. With the hard
option (default one), the boot process will pause if there is a problem mounting the nfs share and repeated tries are made to mount the share indefinitely. If the soft
option is used, then the mount fails after retrans
retransmissions have been sent.
On the other hand, autofs only mounts nfs shares when they are needed and accessed.
The benefit of autofs would be you can boot your server (and use it) as normal when an NFS mount is inaccessible. Only the user/application that wants to access the NFS mount will notice the unavailability. With fstab your server might refuse to boot (hard option), boot very slowly (hard option with timeout), or you might have to manually re-mount the unavailable NFS mount each time it failed (soft option). Please someone correct me if I'm wrong.