World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0000787836
Reproduction Date:

Title: Fstab  
Author: World Heritage Encyclopedia
Language: English
Subject: Mount (Unix), Disk quota, NetBSD, Richacls, Automounter
Collection: Configuration Files, Unix File System Technology
Publisher: World Heritage Encyclopedia


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 are not necessarily 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 still 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.


  • Modern use 1
  • Example 2
  • Options common to all filesystems 3
  • Filesystem specific options 4
    • ext2 4.1
    • fat 4.2
    • fat, ntfs 4.3
    • nfs 4.4
  • Mounting all filesystems 5
  • See also 6
  • References 7
  • External links 8

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, such as the Kfstab graphical configuration utility available for KDE.

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 an 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
//pingu/ashare  /store/pingu    cifs         credentials=/root/smbpass.txt                       0 0

# mounting NFS
pingu:/store    /store          nfs          rw                                                  0 0

The order of the rows (or entries) of the table is not significant; in addition, blank lines and comment lines beginning with a "#" are ignored.

The space- or tab-separated fields within each row (typically aligned in columns, as above, but this is not a requirement) must appear in a specific order, as follows:

  1. device-spec – The device name, label, UUID, or other means of specifying the partition or data source this entry refers to.
  2. mount-point – Where the contents of the device may be accessed after mounting; for swap partitions or files, this is set to none.
  3. fs-type – The type of file system to be mounted.
  4. 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 predetermined set of options depending on the file system type.
  5. dump – A number indicating whether and how often the file system should be backed up by the dump program; a zero indicates the file system will never be automatically backed up.
  6. pass – A number indicating the order in which the fsck program will check the devices for errors at boot time; this is 1 for the root file system and either 2 (meaning check after root) or 0 (do not check) for all other devices.

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 the octal character code \040.

Options common to all filesystems

As the filesystems in /etc/fstab will eventually be mounted using mount(8) it is not surprising that the options field simply contains a comma-separated list of options which will be passed directly to mount when it tries to mount the filesystem.

The options common to all filesystems are:

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. If you do not want the device to be mounted automatically, use the noauto option in /etc/fstab. With noauto, the device can be only mounted explicitly.
dev / nodev
Interpret/do not interpret block special devices on the filesystem.
exec / noexec
exec lets you execute binaries that are on that partition, whereas noexec does not let you do that. noexec might be useful for a partition that contains no binaries, like /var, or contains binaries you do not want to execute on your system, or that cannot even be executed on your system, as might be the case of a Windows partition.
rw / ro
Mount the filesystem in either read write or read only mode. Explictly 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 partitions.
sync / async
How the input and output to the filesystem should be done. sync means it is done synchronously. If you look at the example fstab, you will notice that this is the option used with the floppy. In plain English, this means that when you, for example, copy a file to the floppy, the changes are physically written to the floppy at the same time you issue the copy command.
suid / nosuid
Permit/Block the operation of suid, and sgid bits.
user / users / nouser
user permits any user to mount the filesystem. This automatically implies noexec, nosuid, nodev unless 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.
Use default settings. Default settings are defined per file system at the file system level. For ext3 file systems these can be set with the tune2fs command. The normal default for Ext3 file systems is equivalent to rw,suid,dev,exec,auto,nouser,async(no acl support). Modern Red Hat based systems set acl support as default on the root file system but not on user created Ext3 file systems. Some file systems such as XFS 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 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 (9 June 2009), relatime is the default.[1]

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 systems have generally provided similar functionality but with slightly different syntax.


check={none, normal, strict}
Sets the fsck checking level.
Print debugging info on each remount .
n is the block which should be used as the superblock for the fs.


check={r[elaxed], n[ormal], s[trict]}
Not the same as ext2, but rather deals with allowed filenames. See mount(8).
conv={b[inary], t[ext], a[uto]}
Performs DOS <---> UNIX text file conversions automatically. See mount(8).

fat, ntfs

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. Note: though FAT/NTFS are the most common use case, 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
Sets the user file creation mode mask, umask, the same for directories only, dmask and for files only, fmask.

More detailed information about the fstab file can be found in the man page about Linux fstab; for other systems see below.


where 'ip' means IP address

Mounting all filesystems

mount -a

This command will mount all (not-yet-mounted) filesystems mentioned in fstab and is used in system script startup during booting. Note that this command will ignore all those entries containing "noauto" in the options section.

See also


  1. ^ Linux 2 6 30 at Linux Kernel Newbies

External links

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.