
The fstab (for file systems table) file is commonly found on Unix systems as part of the system configuration. The fstab file typically lists all available disks and disk partitions, and indicates how they are to be initialized or otherwise integrated into the overall system's file system.
The fstab file is most commonly used by the mount command, which reads the fstab file to determine which options should be used when mounting the specified device.
Traditionally, the fstab was only read by programs, and not written. 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 systems use udev to handle hot swapping devices instead of rewriting fstab file on the fly. It is the duty of the system administrator to properly create and maintain this file.
The file may have other names on a given Unix variant; for example, it is /etc/vfstab on Solaris.
Contents |
The following is an example of an fstab file on a Red Hat Linux system:
# device name mount point fs-type options dump-freq pass-num LABEL=/ / ext3 defaults 1 1 /dev/hda6 swap 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 /mount/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0 /dev/fd0 /mount/floppy auto noauto,owner,kudzu 0 0 # NTFS Windows XP partition /dev/hda1 /mnt/WinXP ntfs-3g quiet,defaults,locale=en_US.utf8,umask=0 0 0 # Partition shared by Windows and Linux /dev/hda7 /mnt/shared vfat umask=000 0 0 # mounting tmpfs tmpfs /mnt/tmpfschk tmpfs size=100m 0 0
The columns are as follows:
A value of zero in either of the last 2 columns disables the corresponding feature.[1]
As the filesystems in /etc/fstab will eventually be mounted using mount(8) it isn't 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 / noautodev / nodevexec / noexecrorwsync / asyncsuid / nosuiduser / users / nouseruser 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.owner (This is Linux specific)defaultsrw,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 over ridden in /etc/fstab.There are many options for the specific filesystems supported by mount. Listed below are some of the more commonly used. For the full list check out the man page for mount.
check={none, normal, strict}debugsb=ncheck={r[elaxed], n[ormal], s[trict]}conv={b[inary], t[ext], a[uto]}uid=n, gid=numask=nnn, dmask=nnn, fmask=nnnnorockMore detailed information about the fstab file can be found in the man page about it.[2]
mount -a
This command will mount all (not-yet-mounted) filesystems mentioned in fstab and is used in system script startup during booting.
Why are we here?
All text is available under the terms of the GNU Free Documentation License
This page is cache of Wikipedia. History