 |
Index for Section 4 |
|
 |
Alphabetical listing for F |
|
fstab(4)
NAME
fstab - Static information about file systems and swap partitions
SYNOPSIS
/etc/fstab
DESCRIPTION
The /etc/fstab file contains descriptive information about the known file
systems and the disk partitions used for swapping (and dumping). The
/etc/fstab file is read by various programs. When you install the
operating system, the local file systems and the partitions for the swap
areas are included in the /etc/fstab file. Each file system or swap
partition is described on a separate line; fields on each line are
separated by tabs or spaces. When you boot the system, only the file
systems specified in the /etc/fstab file are mounted.
The following is an example of an /etc/fstab file:
/dev/rz2a / ufs rw 1 1
/dev/rz0g /usr ufs rw 1 2
/dev/rz2b swap1 ufs sw 0 2
/dev/rz0b swap2 ufs sw 0 2
/dev/rz2g /var ufs rw 1 2
/dev/rz3c /usr/users ufs rw 1 2
/usr/share/man@rabbit /usr/share/man nfs ro,bg 0 0
usr_dmn#user1 /usr/user1 advfs rw,userquota,groupquota 0 2
The order of the lines in the /etc/fstab file is important because the
fsck, mount, and umount commands read the file sequentially from top to
bottom.
The syntax of a line in the /etc/fstab file is as follows. Note that lines
beginning with a hash (#) sign are ignored. Blank lines are also ignored.
file_spec mnt_point fs_type mnt_options backup fsck
The first field, (file_spec), describes the block special device, the
remote file system directory, or the AdvFS fileset to be mounted. For UFS
file systems, the special file name is the block special file name, and not
the character special file name. If a program needs the character special
file name, the program must create it by appending the letter r after the
last / (slash) in the special file name (for example, /dev/rrz0g). For mfs
file systems, file_spec can also specify the size in 512-byte sectors,
using the following syntax:
-ssize
See mfs(8) for more information.
The second field, (mnt_point), specifies either the mount point for the
file system or remote directory or swap1 or swap2 for the primary or
secondary swap partition, respectively.
The third field, (fs_type), specifies the type of file system. Specify ufs
for swap partitions. The system currently supports the following file
systems:
cdfs Specifies an ISO 9660 or High Sierra Formatted (CD-ROM) file
system.
dvdfs Specifies a Universal Disk Format (UDF) formatted file system.
nfs Specifies a Network File System.
procfs Specifies a /proc file system, which allows you to access and
manipulate running processes as if they were files. The /proc
file system is used for debugging purposes. You must specify 0
(zero) in the freq and order fields because the /proc file system
should not be backed up or checked.
ufs Specifies a local UNIX file system or a swap partition.
mfs Specifies the memory file system.
advfs Specifies a local Advanced File System.
The fourth field, (mnt_options), describes the mount options associated
with the file system or partition. It is formatted as a comma separated
list of options and must contain, at a minimum, one of the following mount
options. There are no default mount options; the subsequent mount
operation fails if you do not specify a mount option or if you specify an
incorrect or undocumented mount option. See mount(8) for a complete list
and description of the legal mount options for the various file system
types.
ro Specifies that the file system is mounted with read-only access.
rq Specifies that the file system is mounted with read-write access.
rw Specifies that the file system is mounted with read-write access.
dirty Specifies that the file system can be mounted even if it was not
cleanly unmounted. This is only for UFS.
userquota [=filename] and groupquota [=filename]
If quotas are to be enforced for users or groups, one or both of
the options must be specified. If userquota is specified, user
quotas are to be enforced. If groupquota is specified, group
quotas are to be enforced.
These options can also specify the location of the quota files;
either userquota, groupquota, or both can be specified. When the
quota commands (for example, quotacheck and quotaon) are run,
they first access the quota files. By default, user and group
quotas for a file system are contained in the quota.user and
quota.group files, which are located in the directory specified
by the mount point. For example, the quotas for the file system
on which /usr is mounted are located in the /usr directory. You
also can specify another file name and location. For example:
userquota=/var/quotas/tmp.user
Note that quota options apply only to UFS and AdvFS file systems.
sw Specifies that the partition is used as swap space. Use the
swapon command to specify additional swap space. [Because Tru64
UNIX does not currently support paging and swapping to a regular
file, the following options are not supported.] If you specify
the sw mount option, you can also specify the following options
that apply to partitions used as swap space:
pri=n Specifies the swap space priority. The n variable can
be 0, 1, 2, 3, 4, with 0 being lowest priority, and 4
being highest priority.
lowater=n Specifies the low water mark. If the paging file grows
larger than the low water mark, and then shrinks below
the low water mark, the operating system will not make
the file smaller than the low water mark. If the low
water mark is set to 0, then the paging file will not
shrink after paging space is freed. The default value
for the low water mark is 20Mbytes.
hiwater=n Specifies the high water mark, which is the limit to
which the operating system will expand the paging file.
The default value for the high water mark is unlimited.
xx Specifies that the file system entry should be ignored.
The fifth field, (backup), is used by the dump command to determine which
file systems need to be backed up. If the fifth field is not present, a
value of zero is returned and dump assumes that the file system does not
need to be backed up. AdvFS ignores this field.
For UFS file systems, the sixth field, (fsck), is used by the fsck command
to determine the order in which file system checks are done at reboot time.
For the root file system, specify 1 in the fsck field. For other UFS file
systems specify 2 or higher in the fsck field. Each ufs file system should
have a unique fsck value.
For AdvFS filesets, the the sixth field is a pass number field that allows
the quotacheck command to perform all of the consistency checks needed for
the fileset. For the root file system, specify 1 in the fsck field. Each
AdvFS fileset in an AdvFS file domain should have a unique fsck value,
which should be 2 or higher.
File systems that are on the same disk are checked sequentially, but file
systems on different disks are checked at the same time to utilize
parallelism available in the hardware. If the sixth field is not present
or zero, a value of zero is returned and the fsck command assumes that the
file system does not need to be checked.
The following information is from the /usr/include/fstab.h file:
struct fstab {
char *fs_spec; /* block special device name */
char *fs_file; /* file system path prefix */
char *fs_vfstype; /* type of file system */
char *fs_mntops; /* comma separated mount options */
char *fs_type; /* rw, ro, sw, or xx */
int fs_freq; /* dump frequency, in days */
int fs_passno; /* pass number on parallel dump */
};
You can read records from the /etc/fstab file by using the getfsent(),
getfsspec(), getfstype(), and getfsfile() routines.
RELATED INFORMATION
Files: /usr/include/fstab.h
Commands: swapon(8), advfs(4), getfsent(3), fsck(8), mount(8), umount(8)