Differences between revisions 1 and 2
Revision 1 as of 2021-06-02 20:18:12
Size: 1929
Comment:
Revision 2 as of 2023-06-22 20:40:30
Size: 1967
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Linux/fstab

fstab

The fstab file is a list of hardware devices, file system drive mounts, and mount options. It can be found at /etc/fstab on a Linux system.

Additionally, running mount -a will loop through this file.


Configuration

This fstab file is structured as:

# <volume>    <dir>     <type> <options>   <dump> <fsck>
/dev/sda1     none      swap   defaults    0      2
/dev/sda2     /         ext4   rw,relatime 0      1
UUID=abcdefg  /mnt/hdd  ext4   rw,noatime  0      0

Spacing between columns is arbitrary. You can mix device filenames and volume UUIDs, though the latter are considered more durable. You can get the UUID of a volume with blkid. You can get the file system type of a device also with blkid.

Options

The <options> column can contain any of:

  • defaults (rw, suid, dev, exec, auto, nouser, async)

  • ro or rw - read-only/read-write permission

  • exec or noexec - allow/disallow execute permission

  • relatime, strictatime, or noatime - syncing access times relative to modify time, absolutely, or not at all

  • nodev - disallow special device files (recommended for hardening)

  • nosuid - disallow operation of SUID bit (recommended for hardening)

  • noauto - do not mount automatcally (i.e. with mount -a)

  • nofail - do not indicate errors if unavailable

  • user or nouser - allow/disallow user mounting

dump

The <dump> column is used by the dump utility. If you don't need that utility (and most people don't), set it to 0.

fsck

The <fsck> column is used by the fsck utility, and enables boot-time file system checks.

  • 0 disables checks.

  • 1 runs corrections based on checks. This is important for the root device.

  • 2 forces reboot on error.


CategoryRicottone

Linux/FsTab (last edited 2023-06-22 20:41:42 by DominicRicottone)