fstab (after ''
file system
In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
s table'') is a
system file A system file in computers is a critical computer file without which a computer system may not operate correctly. These files may come as part of the operating system, a third-party device driver or other sources. Microsoft Windows and MS-DOS mark ...
commonly found in the directory
/etc
on
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
and
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
computer systems. In
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, it is part of the
util-linux
is a standard package distributed by the Linux Kernel Organization for use as part of the Linux operating system. A fork, (with meaning "next generation"), was created when development stalled, but has been renamed back to , and is the offic ...
package. The fstab file typically lists all available disk
partition
Partition may refer to:
Computing Hardware
* Disk partitioning, the division of a hard disk drive
* Memory partition, a subdivision of a computer's memory, usually for use by a single job
Software
* Partition (database), the division of a ...
s 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
Mount is often used as part of the name of specific mountains, e.g. Mount Everest.
Mount or Mounts may also refer to:
Places
* Mount, Cornwall, a village in Warleggan parish, England
* Mount, Perranzabuloe, a hamlet in Perranzabuloe parish, C ...
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
A system administrator, or sysadmin, or admin is a person who is responsible for the upkeep, configuration, and reliable operation of computer systems, especially multi-user computers, such as servers. The system administrator seeks to ensu ...
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
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
; for example, it is found at
/etc/vfstab
on
Solaris
Solaris may refer to:
Arts and entertainment Literature, television and film
* ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem
** ''Solaris'' (1968 film), directed by Boris Nirenburg
** ''Solaris'' (1972 film), directed by ...
systems.
Modern use
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
udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices ...
as an
automounter An automounter is any program or software facility which automatically mounts filesystems in response to access operations by user programs. An automounter system utility (daemon under Unix), when notified of file and directory access attempts unde ...
to handle the
hot swapping
Hot swapping is the replacement or addition of components to a computer system without stopping, shutting down, or rebooting the system; hot plugging describes the addition of components only. Components which have such functionality are said ...
of devices (such as MP3 players or digital cameras) instead of relying on fstab. Programs such as
pmount
In computing, mount is a command in various operating systems. Before a user can access a file on a Unix-like machine, the file system on the device which contains the file needs to be mounted with the mount command. Frequently mount is used for ...
allow ordinary users to
mount
Mount is often used as part of the name of specific mountains, e.g. Mount Everest.
Mount or Mounts may also refer to:
Places
* Mount, Cornwall, a village in Warleggan parish, England
* Mount, Perranzabuloe, a hamlet in Perranzabuloe parish, C ...
and unmount filesystems without a corresponding fstab entry; traditional Unix has always allowed privileged users (the
root user
In computing, the superuser is a special user account used for system administration. Depending on the operating system (OS), the actual name of this account might be root, administrator, admin or supervisor. In some cases, the actual name of th ...
and users in the
wheel group) to mount or unmount devices without a corresponding fstab entry.
Example
The following is an example of an fstab file on a typical
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
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.
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:
# ''device-spec'' – The device name, label,
UUID
A universally unique identifier (UUID) is a 128-bit label used for information in computer systems. The term globally unique identifier (GUID) is also used.
When generated according to the standard methods, UUIDs are, for practical purposes, un ...
, or other means of specifying the partition or data source this entry refers to.
# ''mount-point'' – Where the contents of the device may be accessed after
mount
Mount is often used as part of the name of specific mountains, e.g. Mount Everest.
Mount or Mounts may also refer to:
Places
* Mount, Cornwall, a village in Warleggan parish, England
* Mount, Perranzabuloe, a hamlet in Perranzabuloe parish, C ...
ing; for
swap
Swap or SWAP may refer to:
Finance
* Swap (finance), a derivative in which two parties agree to exchange one stream of cash flows against another
* Barter
Science and technology
* Swap (computer programming), exchanging two variables in t ...
partitions or files, this is set to
none
.
# ''fs-type'' – The type of file system to be mounted.
# ''options'' – Options describing various other aspects of the file system, such as whether it is automatically mounted at boot, which users may mount or access it, whether it may be written to or only read from, its size, and so forth; the special option
defaults
refers to a pre-determined set of options depending on the file system type.
# ''dump'' – A number indicating whether and how often the file system should be
backed up
Constipation is a bowel dysfunction that makes bowel movements infrequent or hard to pass. The Human feces, stool is often hard and dry. Other symptoms may include abdominal pain, bloating, and feeling as if one has not completely passed the bo ...
by the
dump program; a zero indicates the file system will never be automatically backed up.
# ''pass'' – A number indicating the order in which the
fsck
The system utility fsck (''file system consistency check'') is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux, macOS, and FreeBSD. A similar command, CHKDSK, exists in Microsoft Windows ...
program will check the devices for errors at boot time:
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 character
In computer programming, whitespace is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character does not correspond to a visible mark, but typically does occupy an area ...
s in the first, second, and fourth fields are indicated by a ''@'' symbol;
U+0040
.
Options common to all filesystems
;
auto
/
noauto
: With the auto option, the device will be mounted automatically at bootup or when the mount -a command is issued. auto is the default option. For the device not to be mounted automatically, the noauto option is used in /etc/fstab. With noauto, the device can be only mounted explicitly.
;
dev
/
nodev
: Controls behavior of the interpretation of block special devices on the filesystem.
;
exec
/
noexec
: exec lets binaries that are on the partition be executed, whereas noexec is the opposite. noexec might be useful for a partition that contains no binaries, like /var, or contains binaries the user may not want to execute on the system, or that cannot even be executed on the system, as might be the case of a Windows partition.
;
rw
/
ro
: Mount the filesystem in either read write or read only mode. Explicitly defining a file system as rw can alleviate some problems in file systems that default to read only, as can be the case with floppies or
NTFS
New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred fil ...
partitions.
;
sync
/
async
: How the input and output to the filesystem should be done. sync means it is done synchronously. Looking at the example fstab, this is the option used with the floppy. This means that when, for example, a file is copied to the floppy, the changes are physically written to the floppy at the same time copy command is issued.
;
suid
/
nosuid
: Controls the behavior of the operation of
suid
The Unix access rights flags setuid and setgid (short for ''set user identity'' and ''set group identity'') allow users to run an executable with the file system permissions of the executable's owner or group respectively and to change behaviour ...
, and
sgid bits.
;
user
/
users
/
nouser
:
user
permits any user to mount the filesystem. This automatically implies
noexec
,
nosuid
,
nodev
unless explicitly overridden. If
nouser
is specified, only
root
In vascular plants, the roots are the organs of a plant that are modified to provide anchorage for the plant and take in water and nutrients into the plant body, which allows plants to grow taller and faster. They are most often below the sur ...
can mount the filesystem. If
users
is specified, every user in group ''users'' will be able to unmount the volume.
;
defaults
: Use default settings. Default settings are defined per file system at the file system level. For
ext3
ext3, or third extended filesystem, is a journaled file system that is commonly used by the Linux kernel. It used to be the default file system for many popular Linux distributions. Stephen Tweedie first revealed that he was working on extend ...
file systems these can be set with the ''tune2fs'' command. The normal default for
ext3
ext3, or third extended filesystem, is a journaled file system that is commonly used by the Linux kernel. It used to be the default file system for many popular Linux distributions. Stephen Tweedie first revealed that he was working on extend ...
file systems is equivalent to
rw,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
XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993. It was the default file system in SGI's IRIX operating system starting with its version 5.3. XFS was ported to the Linux kernel in 2001; as ...
enable ACLs by default. Default file system mount attributes can be overridden in /etc/fstab.
;
owner
(Linux-specific)
: Permit the owner of device to mount.
;
atime
/
noatime
/
relatime
/
strictatime
(Linux-specific)
:The Unix
stat
STAT, Stat. , or stat may refer to:
* Stat (system call), a Unix system call that returns file attributes of an inode
* ''Stat'' (TV series), an American sitcom that aired in 1991
* Stat (website), a health-oriented news website
* STAT protein, a ...
structure records when files are last accessed (''atime''), modified (mtime), and changed (''ctime''). One result is that
atime is written every time a file is read, which has been heavily criticized for causing performance degradation and increased wear. However, atime is used by some applications and desired by some users, and thus is configurable as atime ''(update on access)'', noatime ''(do not update)'', or (in Linux) relatime ''(update atime if older than mtime)''. Through Linux 2.6.29, ''atime'' was the default; as of 2.6.30, ''relatime'' is the default.
Linux 2 6 30
at Linux Kernel Newbies
Filesystem-specific options
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
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems have generally provided similar functionality but with slightly different syntax or forms.
ext2
; check= one, normal, strict/code>
: Sets the fsck checking level.
; debug
: Print debugging info on each remount.
; sb=n
: n
is the block
Block or blocked may refer to:
Arts, entertainment and media Broadcasting
* Block programming, the result of a programming strategy in broadcasting
* W242BX, a radio station licensed to Greenville, South Carolina, United States known as ''96.3 ...
which should be used as the super-block for the filesystem.
FAT-only
; check= (elaxed), n(ormal), s(trict)/code>
: Policy for allowed filenames. See mount(8)
.
; conv= (inary), t(ext), a(uto)/code>
: Performs DOS <=> UNIX text file conversions automatically. See mount(8)
.
FAT, NTFS
; windows_names
: Linux filesystems have a larger set of allowed characters in filenames. windows_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=n
: Sets the user identifier ( uid), and group identifier ( gid) for all files on the filesystem.
; umask=nnn, dmask=nnn, fmask=nnn
: Controls masking of filesystem nodes.
umask
In computing, umask is a command (computing), command that determines the settings of a Mask (computing), mask that controls how file permissions are set for newly created files. It may also affect how the file permissions are changed explicitly. ...
- user file creation
dmask - directory creation
fmask
fstab (after ''file systems table'') is a system file commonly found in the directory /etc 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 o ...
- for files only
More detailed information about the fstab file can be found in the man page
A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and ev ...
fo
Linux fstab
for other systems see below.
NFS
; addr=ip
: ip
is a valid IP address
An Internet Protocol address (IP address) is a numerical label such as that is connected to a computer network that uses the Internet Protocol for communication.. Updated by . An IP address serves two main functions: network interface ident ...
.
See also
* mount (computing)
Mounting is a process by which a computer's operating system makes files and directories on a storage device (such as hard drive, CD-ROM, or network share) available for users to access via the computer's file system.
In general, the process o ...
* mount (Unix)
In computing, mount is a command in various operating systems. Before a user can access a file on a Unix-like machine, the file system on the device which contains the file needs to be mounted with the mount command. Frequently mount is used for ...
* mtab
The mtab (contraction of '' mounted file systems table'') file is a system information file, commonly found on Unix-like systems.
Overview
This file lists all currently mount (Unix), mounted filesystems along with their initialization options. m ...
References
External links
*
*
*
*
fstab man page
from Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
*
fstab (5)
- on
Ubuntu Manpage Repository
Kfstab
{{unix commands
Configuration files
Unix file system technology