/etc/fstab mounting directory files in Linux

Source: Internet
Author: User

A simple /etc/fstab , use kernel name to identify the disk:

/etc/fstab
# <file system>        <dir>         <type>    <options>             <dump> <PASS>TMPFS          /tmp tmpfs     nodev,nosuid          0      0/dev/sda1              /             ext4      defaults,noatime      0      1 /dev/sda2              None          swap      defaults              0      0/dev/sda3/home         ext4      defaults,noatime      0      2
Field Definition

/etc/fstabThe file contains the following fields, separated by spaces or tabs:

<file system><dir><type><options><dump><pass>
    • <file systems> -the partition or storage device that you want to mount.
    • <dir> -mount position of the <file systems>.
    • <type> -to mount the file system type of the device or partition, support many different file systems:,,,,,,,,,, ext2 ext3 ext4 reiserfs xfs jfs smbfs iso9660 vfat c13/>, swap and auto . Set to auto type, the Mount command guesses the type of file system used and is useful for mobile devices such as CDROM and DVDs.
    • <options> -parameters used when mounting, note that some mount parameters are only available for specific file systems. Some of the more commonly used parameters are:
  • auto-Mounts automatically at startup or mount -a when a command is typed.
  • noauto-is only mounted under your command.
  • exec-binary files that are allowed to execute this partition.
  • noexec-Binary files on this file system are not allowed to execute.
  • ro-mount the file system in read-only mode.
  • rw-mount the file system in read/write mode.
  • user-Allows any user to mount this file system, if no display definition, implied enable noexec , nosuid nodev parameter.
  • users-Allows the user in all users groups to mount the file system.
  • nouser-can only be mounted by root.
  • owner-Allow the device owner to mount.
  • sync-I/O synchronization is performed.
  • async-I/O is asynchronous.
  • dev-Parse the block special device on the file system.
  • nodev-Block special devices on the file system are not parsed.
  • suid-Allows SUID to operate and set sgid bits. This parameter is typically used for special tasks that temporarily elevate permissions when a general user runs the program.
  • nosuid-Disable SUID operation and set Sgid bit.
  • noatime-You can improve performance by not updating Inode access records on the file system (see Atime parameters).
  • nodiratime-You can improve performance by not updating the directory Inode Access records on the file system (see the Atime parameter).
  • relatime-Update inode access records in real time. Only the access time in the record is older than the current access will be updated. (similar to Noatime, but does not interrupt processes such as Mutt or other programs that detect whether a file has been modified since it was last accessed.) ) To improve performance (see Atime parameters).
  • flush- vfat the option to refresh the data more frequently, the Copy dialog box or the progress bar disappears after all data has been written.
  • defaults-Using the default mount parameters of the file system, for example, ext4 the default parameters are:,,,,, rw suid dev exec auto nouser , async .
    • The <dump> Dump tool determines when to make a backup. Dump checks its contents and uses numbers to determine whether to back up the file system. The allowed numbers are 0 and 1. 0 means ignore, 1 for backup. Most of the users are not installing dump, and for them <dump> should be set to 0.
    • <pass> fsck reads <pass> values to determine the order in which the file system needs to be checked. The allowed numbers are 0, 1, and 2. The root directory should have the highest priority of 1, and all other devices that need to be checked are set to 2. 0 means the device will not be checked by fsck.

/etc/fstab mounting directory files in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.