Linux - fstab


What is the purpose of the /etc/fstab file?

This file contains a list of filesystems, their mount point, other configuration parameters such as which filesystems should be automatically mount.

What is the format of the /etc/fstab file?

block_special    mount_location    type    opts    dump_freq    pass_numb

The opts column is comma-separated:

  • rw: read and write
  • ro: readonly
  • suid: the SUID access mode is permitted (the default)
  • nosuid: The SUID access mode is not permitted
  • noauto: Do not automatically mount this filesystem
  • rq: Quota may be placed in effect (Digital Unix)
  • quota: Quota may be placed in effect (Sun OS, IRIX)
  • usrquota: User quota may be placed in effect (Linux)
  • grpquota: Group quota may be placed in effect (Linux)
  • swap (or sw): swap partition

The dump_freq column is a decimal number indicating the frequency with which the filesystem should be backup by the dump utilities. A value of 1 means backup should be done everyday, 2 means every other day, and so on.

The pass_number column is a decimal number indicating the order with which fsck should check the filesystem. A pass_number 1 indicate that the filesystem should be checked first. The root filesystem must have pass_number 1. Filesystem on one disk drive must have different pass number. Filesystems on separate disk drives can have the same pass number, allowing fsck to check the filesystems in parallel. This field should be 0 for swap partition.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License