/etc/fstab has the static information about the filesystems on linux and UNIX, including local and remote directory hierarchies, most of which the system mounts automatically when it boots.

It has six columns, here is an example:

UUID=92915c44-79ca-488d-a724-a05ba81509f0 /                       ext4    defaults        1 1
UUID=d8e53d94-6b8a-4935-aee1-bd68367a7ebe /boot                   ext4    defaults        1 2
/dev/mapper/vg0-home    /home                   ext4    defaults        1 2
/dev/mapper/vg0-opt     /opt                    ext4    defaults        1 2
/dev/mapper/vg0-tmp     /tmp                    ext4    defaults        1 2
/dev/mapper/vg0-usr     /usr                    ext4    defaults        1 2
/dev/mapper/vg0-var     /var                    ext4    defaults        1 2
UUID=ee369d62-ecc0-4631-a955-1a920b08994c swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/mapper/lun0        /lun0          xfs     defaults        0 0
/dev/mapper/lun1        /lun1           xfs     defaults            0 0

Below is a quick description for 6 columns from left to right.


The name,label or UUID number of a local block device or a pointer to a remote directory hierarchy. In the list above, / and /boot filesystems use UUID as label, this is to keep consistent device naming. Because udev manages device naming dynamically. Thus, use UUID can keep partitions and mount points correctly correlated when you remove or exchange devices. Use blkid can list device UUID numbers.

Mount point

The name of the directory file that the filesystem/directory hierarchy is to be mounted on. If it does not already exist, create this directory using mkdir.

For swap, it should be none


The type of filesystem/directory hierarchy that is to be mounted. This field describes the type of the filesystem.  Linux supports many filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs, hfsplus, tmpfs, sysfs, proc, iso9660, udf, squashfs, nfs, cifs, and many more.

Mount options

A comma separated list of mount options, such as whether the filesystem is mounted for reading and writing(rw, default) or reading only. See more options available for nfs, xfs.

Basic filesystem-independent options are:

   defaults use default options: rw, suid, dev, exec, auto, nouser, and async.
   noauto do not mount when "mount -a" is given (e.g., at boot time)
   user   allow a user to mount
   owner  allow device owner to mount
   comment or x-<name> for use by fstab-maintaining programs
   nofail do not report errors for this device if it does not exist.

Previously used by dump to determine when to back up the filesystem, default value is 0(don't dump).


Specifies the order in which fsck checks filesystems. Root(/) should have a 1 in this column. Filesystems that are mounted to a directory just below the root directory should have a 2 Filesystems that are mounted on another mounted filesystem(other than root) should have a 3.

However, some filesystems like xfs, CD/DVD, do not need to be checked, so the value should be 0. the default value is 0(no fsck)

/proc/mounts and /etc/mtab are two files keep mounted filesystem info, one for kernel, the other for user space. For more detail about them, see Understanding the difference between /etc/mtab and /proc/mounts on linux

Comments powered by CComment