How to specify NFS mount options in linux?



  • To add specific NFS mount options, add the options to the relevant entry in /etc/fstab.
    The syntax of /etc/fstab is:
    server:/exported_filesystem /local_directory nfs_version options 0 0

    For example:
    10.20.30.23:/customers/files /data nfs nosuid,tcp 0 0

    Examples of available options are (a comprehensive list can be found in the man page for nfs and mount:
    hard / soft: with the hard option, the application using a file via NFS will stop and wait for the server to come back online (if the nfs server is unavailable), or, with the soft option, an error will be reported.
    With the hard option, the user is unable to terminate the process waiting for the NFS communication to resume except if the intr option is also specified.
    With the soft option, the user can set an extra option of timeo= ( is the number of seconds to wait before the error is reported).
    If is recommended not to use the soft option as you could end up with a lot of errors being generated on congested or extremely busy networks.

    intr: this option allows users to interrupt NFS requests if the NFS server becomes unavailable.

    nfsvers=2 or nfsvers=3: clarifies which NFS version to use. If you don't specify a version, NFS will use the highest supported version by the kernel and mount command. This option is not supported with NFSv4.

    noacl: this options turns off.

    nolock: this option is useful if you want to disables file locking.

    noexec: if this option is in /etc/fstab, you will not be able to execute binaries on mounted file systems. This comes in handy when you have NFS mounted non-Linux filesystem containing binaries that could be incompatible with your Linux server.

    nosuid: this option stops remote users from gaining higher privileges by running a setuid programme.

    rsize=num and wsize=num: this option is used to speed up NFS communication for reads (rsize) and writes (wsize) by setting a larger data block size (in bytes), to be transferred at one time.
    Use with caution and check that your system can cope with larger block sizes.

    tcp: this option is used to specify for the TCP protocol to be used.

    udp: this option is used to specify for the UDP protocol to be used.


Log in to reply
 

© Lightnetics 2024