The fstab (or file systems table) file is a system configuration file commonly found at /etc/fstab on Unix and Unix-like computer systems. In Linux, it is part of the util-linux package. The fstab file typically lists all available disk partitions and other types of file systems and data sources that may not necessarily be disk-based, and indicates how they are to be initialized or otherwise integrated into the larger file system structure.
The fstab file is read by the mount command, which happens automatically at boot time to determine the overall file system structure, and thereafter when a user executes the mount command to modify that structure. It is the duty of the system administrator to properly create and maintain the fstab file.
While fstab is used for basic system configuration, for other uses, it has been superseded by automatic mounting mechanisms.
The file has other names on some versions of Unix; for example, it is found at /etc/vfstab on Solaris systems.
The fstab file is read by programs that work with disk partitions and other file systems and is not automatically maintained. Instead it is written by the system administrator or sometimes by an operating system installation program. However, some administration tools can automatically build and edit fstab, or act as graphical editors for it.
Modern Linux systems use udev as an automounter to handle the hot swapping of devices (such as MP3 players or digital cameras) instead of relying on fstab. Programs such as pmount allow ordinary users to mount and unmount filesystems without a corresponding fstab entry; traditional Unix has always allowed privileged users (the root user and users in the wheel group) to mount or unmount devices without a corresponding fstab entry.
The following is an example of an fstab file on a typical Linux system.
# device-spec mount-point fs-type options dump pass LABEL=/ / ext4 defaults 1 1 /dev/sda6 none swap defaults 0 0 none /dev/pts devpts gid=5,mode=620 0 0 none /proc proc defaults 0 0 none /dev/shm tmpfs defaults 0 0 # Removable media /dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,ro 0 0 # NTFS Windows 7 partition /dev/sda1 /mnt/Windows ntfs-3g quiet,defaults,locale=en_US.utf8,umask=0,noexec 0 0 # Partition shared by Windows and Linux /dev/sda7 /mnt/shared vfat umask=000 0 0 # Mounting tmpfs tmpfs /mnt/tmpfschk tmpfs size=100m 0 0 # Mounting cifs //cifs_server_name/ashare /store/pingu cifs credentials=/root/smbpass.txt 0 0 # Mounting NFS nfs_server_name:/store /store nfs rw 0 0
The order of records in fstab is important because fsck(8), mount(8), and umount(8) sequentially iterate through fstab and mount in the order defined.[1]
Blank lines and comment lines beginning with a "#" are ignored.
The space or tab-separated fields within each row must appear in a specific order:
none.defaults refers to a pre-determined set of options depending on the file system type. 0 - do not check
1 - check immediately during boot
2 - check after boot
Missing values in the last two fields are interpreted as zeros. If necessary, space characters in the first, second, and fourth fields are indicated by a @ symbol; U+0040.
auto / noautodev / nodevexec / noexecrw / rosync / asyncsuid / nosuiduser / users / nouseruser permits any user to mount the filesystem. This automatically implies noexec, nosuid, nodev unless explicitly overridden. If nouser is specified, only root can mount the filesystem. If users is specified, every user in group users will be able to unmount the volume.defaultsrw,suid,dev,exec,auto,nouser,async. Modern Red Hat based systems set ACL support as default on the root file system but not on user-created ext3 filesystems. Some file systems such as XFS enable ACLs by default. Default file system mount attributes can be overridden in /etc/fstab.owner (Linux-specific)atime / noatime / relatime / strictatime (Linux-specific)There are many options for the specific filesystems supported by mount. Listed below are some of the more commonly used. The full list may be found in the documentation for mount. Note that these are for Linux; traditional Unix-like systems have generally provided similar functionality but with slightly different syntax or forms.
check=[none, normal, strict]debugsb=nn is the block which should be used as the super-block for the filesystem.check=[r(elaxed), n(ormal), s(trict)]mount(8).conv=[b(inary), t(ext), a(uto)]mount(8).windows_nameswindows_names restricts the set of allowed characters for the volume to only those acceptable by Windows; though FAT/NTFS are the most common use cases, this feature is not specifically restricted to those filesystem types.uid=n, gid=numask=nnn, dmask=nnn, fmask=nnnumask - user file creation dmask - directory creation fmask - for files only
More detailed information about the fstab file can be found in the man page for Linux fstab; for other systems see below.
addr=ipip is a valid IP address.