1FSTAB(5)                      File Formats Manual                     FSTAB(5)
2
3
4

NAME

6       fstab - static information about the filesystems
7

SYNOPSIS

9       #include <fstab.h>
10

DESCRIPTION

12       The  file fstab contains descriptive information about the various file
13       systems.  fstab is only read by programs, and not written;  it  is  the
14       duty  of  the system administrator to properly create and maintain this
15       file.  Each filesystem is described on a separate line; fields on  each
16       line are separated by tabs or spaces.  The order of records in fstab is
17       important because fsck(8), mount(8), and umount(8) sequentially iterate
18       through fstab doing their thing.
19
20       The  first field, fs_spec, describes the block special device or remote
21       filesystem to be mounted.  For filesystems of  type  ufs,  the  special
22       file name is the block special file name, and not the character special
23       file name.  If a program needs the character  special  file  name,  the
24       program must create it by appending a ``r'' after the last ``/'' in the
25       special file name.
26
27       The second field, fs_file, describes the mount point for  the  filesys‐
28       tem.  For swap partitions, this field should be specified as ``none''.
29
30       The third field, fs_vfstype, describes the type of the filesystem.  The
31       system currently supports only two types of filesystems:
32
33       ufs            a local UNIX filesystem
34
35       swap           a disk partition to be used for swapping
36
37       The fourth field, fs_mntops, describes  the  mount  options  associated
38       with  the  filesystem.   It  is  formatted as a comma separated list of
39       options.  It contains at least the type of mount  (see  fs_type  below)
40       plus any additional options appropriate to the filesystem type.
41
42       If  the option ``quotas'' is specified, the filesystem is automatically
43       processed by the  quotacheck(8)  command,  and  user  disk  quotas  are
44       enabled  with quotaon(8).  Filesystem quotas are maintained in the file
45       named quotas located at the root of the  associated  filesystem.   This
46       restriction on the location of the quotas file is needlessly imposed by
47       the kernel but may be lifted in the future.  Thus, if  the  user  quota
48       file  for  /tmp is stored in /var/quotas/tmp.user, this location can be
49       specified as:
50
51              quotas=/var/quotas/tmp.user
52
53       The type of the mount is extracted from the fs_mntops field and  stored
54       separately  in  the fs_type field (it is not deleted from the fs_mntops
55       field).  If fs_type is ``rw'' or ``ro'' then the filesystem whose  name
56       is  given  in the fs_file field is normally mounted read-write or read-
57       only on the specified special file.  If fs_type is ``sw'' then the spe‐
58       cial  file  is made available as a piece of swap space by the swapon(8)
59       command at the end of the system reboot procedure.   The  fields  other
60       than fs_spec and fs_type are unused.  If fs_type is specified as ``xx''
61       the entry is ignored.  This is useful to show disk partitions which are
62       currently unused.
63
64       The  fifth field, fs_freq, is used for these filesystems by the dump(8)
65       command to determine which filesystems need to be dumped.  If the fifth
66       field  is  not  present,  a  value of zero is returned and dump(8) will
67       assume that the filesystem does not need to be dumped.
68
69       The sixth field, fs_passno, is used by the fsck(8) program to determine
70       the order in which filesystem checks are done at reboot time.  The root
71       filesystem should be  specified  with  a  fs_passno  of  1,  and  other
72       filesystems  should  have a fs_passno of 2.  Filesystems within a drive
73       will be checked sequentially, but filesystems on different drives  will
74       be  checked  at  the  same time to utilize parallelism available in the
75       hardware.  If the sixth field is not present or zero, a value  of  zero
76       is  returned  and fsck(8) will assume that the filesystem does not need
77       to be checked.
78
79       #define   FSTAB_RW  "rw" /* read-write device */
80       #define   FSTAB_RO  "ro" /* read-only device */
81       #define   FSTAB_SW  "sw" /* swap device */
82       #define   FSTAB_XX  "xx" /* ignore totally */
83
84       struct fstab {
85            char *fs_spec; /* block special device name */
86            char *fs_file; /* filesystem path prefix */
87            char *fs_vfstype;   /* type of filesystem */
88            char *fs_mntops;    /* comma separated mount options */
89            char *fs_type; /* rw, ro, sw, or xx */
90            int  fs_freq;  /* dump frequency, in days */
91            int  fs_passno;     /* pass number on parallel dump */
92       };
93
94       The proper way to read records from fstab is to use the routines  getf‐
95       sent(3), getfsspec(3), getfstype(3), and getfsfile(3).
96

FILES

98       /etc/fstab     The file fstab resides in /etc.
99

SEE ALSO

101       getfsent(3)
102

HISTORY

104       The fstab file format appeared in 4.0BSD.
105
106
107
1084.4 Berkeley Distribution      January 15, 1996                       FSTAB(5)
Impressum