1FSTAB(5) Linux Programmer's Manual FSTAB(5)
2
3
4
6 fstab - static information about the filesystems
7
9 #include <fstab.h>
10
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. Lines starting with '#' are com‐
17 ments. blank lines are ignored. The order of records in fstab is
18 important because fsck(8), mount(8), and umount(8) sequentially iterate
19 through fstab doing their thing.
20
21 The first field, (fs_spec), describes the block special device or
22 remote filesystem to be mounted.
23
24 For ordinary mounts it will hold (a link to) a block special device
25 node (as created by mknod(8)) for the device to be mounted, like
26 `/dev/cdrom' or `/dev/sdb7'. For NFS mounts one will have
27 <host>:<dir>, e.g., `knuth.aeb.nl:/'. For procfs, use `proc'.
28
29 Instead of giving the device explicitly, one may indicate the (ext2 or
30 xfs) filesystem that is to be mounted by its UUID or volume label (cf.
31 e2label(8) or xfs_admin(8)), writing LABEL=<label> or UUID=<uuid>,
32 e.g., `LABEL=Boot' or `UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'.
33 This will make the system more robust: adding or removing a SCSI disk
34 changes the disk device name but not the filesystem volume label.
35
36 The second field, (fs_file), describes the mount point for the filesys‐
37 tem. For swap partitions, this field should be specified as `none'. If
38 the name of the mount point contains spaces these can be escaped as
39 `\040'.
40
41 The third field, (fs_vfstype), describes the type of the filesystem.
42 Linux supports lots of filesystem types, such as adfs, affs, autofs,
43 coda, coherent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660,
44 jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs,
45 smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs, and possibly
46 others. For more details, see mount(8). For the filesystems currently
47 supported by the running kernel, see /proc/filesystems. An entry swap
48 denotes a file or partition to be used for swapping, cf. swapon(8). An
49 entry ignore causes the line to be ignored. This is useful to show
50 disk partitions which are currently unused. An entry none is useful
51 for bind or move mounts.
52
53 mount(8) and umount(8) support filesystem subtypes. The subtype is
54 defined by '.subtype' suffix. For example 'fuse.sshfs'. It's recom‐
55 mended to use subtype notation rather than add any prefix to the first
56 fstab field (for example 'sshfs#example.com' is depreacated).
57
58 The fourth field, (fs_mntops), describes the mount options associated
59 with the filesystem.
60
61 It is formatted as a comma separated list of options. It contains at
62 least the type of mount plus any additional options appropriate to the
63 filesystem type. For documentation on the available options for non-
64 nfs file systems, see mount(8). For documentation on all nfs-specific
65 options have a look at nfs(5). Common for all types of file system are
66 the options ``noauto'' (do not mount when "mount -a" is given, e.g., at
67 boot time), ``user'' (allow a user to mount), and ``owner'' (allow
68 device owner to mount), and ``comment'' (e.g., for use by fstab-main‐
69 taining programs). The ``owner'' and ``comment'' options are Linux-
70 specific. For more details, see mount(8).
71
72 The fifth field, (fs_freq), is used for these filesystems by the
73 dump(8) command to determine which filesystems need to be dumped. If
74 the fifth field is not present, a value of zero is returned and dump
75 will assume that the filesystem does not need to be dumped.
76
77 The sixth field, (fs_passno), is used by the fsck(8) program to deter‐
78 mine the order in which filesystem checks are done at reboot time. The
79 root filesystem should be specified with a fs_passno of 1, and other
80 filesystems should have a fs_passno of 2. Filesystems within a drive
81 will be checked sequentially, but filesystems on different drives will
82 be checked at the same time to utilize parallelism available in the
83 hardware. If the sixth field is not present or zero, a value of zero
84 is returned and fsck will assume that the filesystem does not need to
85 be checked.
86
87 The proper way to read records from fstab is to use the routines getmn‐
88 tent(3).
89
91 /etc/fstab
92
94 getmntent(3), mount(8), swapon(8), fs(5), nfs(5)
95
97 The ancestor of this fstab file format appeared in 4.0BSD.
98
100 This man page is part of the util-linux-ng package and is available
101 from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
102
103
104
105Linux 2.2 15 June 1999 FSTAB(5)