/etc/fstab basics
Format follows:
device mount_point filesys options dump fsck
For example:
/dev/hda3 / ext3 defaults 0 0
For filesystems, check the man page for fstab for the many options. They include ext2, ext3, swap, vfat, ntfs, reiserfs, etc. The mount point needs to be a valid directory on the host filesystem.
options
auto/noauto - With the auto option, the device will be mounted automatically (at bootup, just like I told you a bit earlier, or when you issue the mount -a command). auto is the default. If you don't want the device to be mounted automatically, use noauto.
user/nouser - The user option allows normal users to mount the device, whereas nouser lets only the root to mount the device. nouser is the default.
exec/noexec - exec lets you execute binaries that are on that partition, whereas noexec doesn't let you do that. noexec might be useful for a partition that contains binaries you don't want to execute on your system, or that can't even be executed on your system. exec is the default.
ro/rw - Mount the filesystem read-only or read-write.
sync/async - How the input and output to the filesystem should be done. sync means it's done synchronously. If you look at the example fstab, you'll notice that this is the option used with the floppy. In plain English, this means that when you, for example, copy a file to the floppy, the changes are physically written to the floppy at the same time you issue the copy command: async is the default.
dev/nodev - Interpret/Do not interpret character or block special devices on the file system.
defaults - uses the default options: rw, suid, dev, exec, auto, nouser, and async.
nfs3 specific options
- rsize=n
The number of bytes NFS uses when reading files from an NFS server. The rsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller. Note: Setting this size to a value less than the largest supported block size will adversely affect performance.
wsize=n
- The number of bytes NFS uses when writing files to an NFS server. The wsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller. Note: Setting this size to a value less than the largest supported block size will adversely affect performance.
- 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. Then, if the filesystem is hard mounted, each new timeout cascade restarts at twice the initial value of the previous cascade, again doubling at each retransmission. The maximum timeout is always 60 seconds. Better overall performance may be achieved by increasing the timeout when mounting on a busy network, to a slow server, or through several routers or gateways.
- retrans=n
The number of minor timeouts and retransmissions that must occur before a major timeout occurs. The default is 3 timeouts. When a major timeout occurs, the file operation is either aborted or a "server not responding" message is printed on the console.
- acregmin=n
The minimum time in seconds that attributes of a regular file should be cached before requesting fresh information from a server. The default is 3 seconds.
- acregmax=n
The maximum time in seconds that attributes of a regular file can be cached before requesting fresh information from a server. The default is 60 seconds.
- acdirmin=n
The minimum time in seconds that attributes of a directory should be cached before requesting fresh information from a server. The default is 30 seconds.
- acdirmax=n
The maximum time in seconds that attributes of a directory can be cached before requesting fresh information from a server. The default is 60 seconds.
- actimeo=n
Using actimeo sets all of acregmin, acregmax, acdirmin, and acdirmax to the same value. There is no default value.
retry=n
The number of minutes to retry an NFS mount operation in the foreground or background before giving up. The default value for forground mounts is 2 minutes. The default value for background mounts is 10000 minutes, which is roughly one week.
namlen=n
When an NFS server does not support version two of the RPC mount protocol, this option can be used to specify the maximum length of a filename that is supported on the remote filesystem. This is used to support the POSIX pathconf functions. The default is 255 characters.
port=n
The numeric value of the port to connect to the NFS server on. If the port number is 0 (the default) then query the remote host's portmapper for the port number to use. If the remote host's NFS daemon is not registered with its portmapper, the standard NFS port number 2049 is used instead.
proto=n
- Mount the NFS filesystem using a specific network protocol instead of the default TCP protocol. Valid protocol types are udp and tcp.
mountport=n
The numeric value of the mountd port.
mounthost=name
The name of the host running mountd.
mountprog=n
Use an alternate RPC program number to contact the mount daemon on the remote host. This option is useful for hosts that can run multiple NFS servers. The default value is 100005 which is the standard RPC mount daemon program number.
mountvers=n
- Use an alternate RPC version number to contact the mount daemon on the remote host. This option is useful for hosts that can run multiple NFS servers. The default value depends on which kernel you are using.
nfsprog=n
Use an alternate RPC program number to contact the NFS daemon on the remote host. This option is useful for hosts that can run multiple NFS servers. The default value is 100003 which is the standard RPC NFS daemon program number.
nfsvers=n
- Use an alternate RPC version number to contact the NFS daemon on the remote host. This option is useful for hosts that can run multiple NFS servers. The default value depends on which kernel you are using.
vers=n
vers is an alternative to nfsvers and is compatible with many other operating systems.
nolock
Disable NFS locking. Do not start lockd. This has to be used with some old NFS servers that don't support locking.
bg
If the first NFS mount attempt times out, retry the mount in the background. After a mount operation is backgrounded, all subsequent mounts on the same NFS server will be backgrounded immediately, without first attempting the mount. A missing mount point is treated as a timeout, to allow for nested NFS mounts.
fg
If the first NFS mount attempt times out, retry the mount in the foreground. This is the complement of the bg option, and also the default behavior.
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.
- hard
If an NFS file operation has a major timeout then report "server not responding" on the console and continue retrying indefinitely. This is the default.
intr
If an NFS file operation has a major timeout and it is hard mounted, then allow signals to interupt the file operation and cause it to return EINTR to the calling program. The default is to not allow file operations to be interrupted.
- posix
Mount the NFS filesystem using POSIX semantics. This allows an NFS filesystem to properly support the POSIX pathconf command by querying the mount server for the maximum length of a filename. To do this, the remote host must support version two of the RPC mount protocol. Many NFS servers support only version one.
nocto
Suppress the retrieval of new attributes when creating a file.
noac
Disable all forms of attribute caching entirely. This extracts a significant performance penalty but it allows two different NFS clients to get reasonable results when both clients are actively writing to a common export on the server.
noacl
Disables Access Control List (ACL) processing.
sec=mode
Set the security flavor for this mount to "mode". The default setting is sec=sys, which uses local unix uids and gids to authenticate NFS operations (AUTH_SYS). Other currently supported settings are: sec=krb5, which uses Kerberos V5 instead of local unix uids and gids to authenticate users; sec=krb5i, which uses Kerberos V5 for user authentication and performs integrity checking of NFS operations using secure checksums to prevent data tampering; and sec=krb5p, which uses Kerberos V5 for user authentication and integrity checking, and encrypts NFS traffic to prevent traffic sniffing (this is the most secure setting). Note that there is a performance penalty when using integrity or privacy.
tcp
Mount the NFS filesystem using the TCP protocol. This is the default protocol.
udp
Mount the NFS filesystem using the UDP protocol instead of the default TCP protocol.
nordirplus
Disables NFSv3 READDIRPLUS RPCs. Use this options when mounting servers that don't support or have broken READDIRPLUS implementations.
- nosharecache
As of kernel 2.6.18, it is no longer possible to mount the same same filesystem with different mount options to a new mountpoint. It was deemed unsafe to do so, since cached data cannot be shared between the two mountpoints. In consequence, files or directories that were common to both mountpoint subtrees could often be seen to be out of sync following an update.
This option allows administrators to select the pre-2.6.18 behaviour, permitting the same filesystem to be mounted with different mount options.
Beware: Use of this option is not recommended unless you are certain that there are no hard links or subtrees of this mountpoint that are mounted elsewhere.
-
fsc
Enable the use of persistent caching to the local disk using the FS-Cache facility for the given mount point.
All of the non-value options have corresponding nooption forms. For example, nointr means don't allow file operations to be interrupted.
more resources
http://linux.die.net/man/5/nfs
http://www.tuxfiles.org/linuxhelp/fstab.html
http://www.google.com/search?q=fstab+options
Comments (0)
You don't have permission to comment on this page.