Configure the startup mount: fstab file Detailed

fstab file Introduction

fstab file contains information storage device and file system on your computer. It was decided a hard disk (partition) is how to use or integrated into the entire file system. Specifically: fstab can be automatically mounted with the various file system formats disks, partitions, removable and remote devices and the like. For Windows and Linux dual operating system user with fstab to mount NTFS partitions formatted FAT format and can share resources under windows system in Linux.

The full path of the file is / etc / fstab. It's just a text file, you can open it with your favorite editor, but must be the root user to edit it. Meanwhile fsck, mount, umount and other commands use the program.

/ Etc / fstab configuration file at startup, but the actual filesystem mount is recorded in / etc / mtab and / proc / mounts among these two files. Every time when we modifier mounted filesystem, and will also cover modifications of these two documents Oh!

System mounted some limitations:

  • Root directory / is to be mounted, but must first be mounted to other mount point came in.
  • Other must mount point, can be specified for the directory has been created, but be sure to comply with the necessary system directory structure principle
  • All mount point at the same time, the mount only once.
  • All partition at the same time, the mount only once.
  • Should be removed, you must first working directory to outside the mount point (and its subdirectories).

File each field

Example:

# <fs>          <mountpoint>    <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/sda10        /boot            ext4     noauto,noatime  1 2
/dev/sda6         /             ext4        noatime        0 1
/dev/sda9         none             swap     sw              0 0
/dev/cdrom        /mnt/cdrom       auto     noauto,ro        0 0

 

In fact, when the / etc / fstab (filesystem table) that we will use the mount command, all the options and arguments to be written to the file it wants. In addition, / etc / fstab also added support for the dump backup command! And whether the file system check fsck commands at startup related.

  • <File systems> Mounting equipment: not our usual understanding of the file system, but to the equipment (hard disks and partitions, DVD drive, etc.). It tells us the name of the device (partition), this is when you use to mount (mount) command line uninstall (umount) equipment.
  • <Mountpoint> mount point: tell us where to mount the device.
  • <Type> file system types: Linux supports many file system. To get a complete list of supported look mount man-page. Typical of these include the names: ext2, ext3, reiserfs, xfs, jfs, iso9660, vfat, ntfs, swap and auto, 'auto' is not a file system, but to mount command to automatically determine the file type, especially for mobile apparatus, floppy disk, DVD drive, it is necessary to do so, because inconsistency may mount each file type.
  • <Opts> file system parameters: This part is the most useful settings! ! ! It enables you to mount the device automatically loads at boot time, the Chinese garbled does not appear that restrictions on read and write permissions to mount the partition. It is related to the mount command usage and, in order to get a complete list, refer to mount manpage.
  • <Dump> Backup command: dump utility to decide whether to make a backup dump checks the entry and use numbers to determine whether the file system backup. The allowed number is 0 and 1. If 0, dump will ignore the file system, and if 1, dump will make a backup. Most of the users are not installed dump, so for them <dump> This entry should be written as 0.
  • <Pass> fsck to check whether the sector: the process of starting, the system will default to test our fsck filesystem is complete (clean). However, some filesystem check is not required, such as the replacement memory space (swap), or a special file systems such as / proc and / sys, and so on. fsck checks the number under the leader to determine the order check the file system, allowing the number is 0, 1, and 2.0 is not tested, 1 represents the first test (usually only the root directory is configured to 1), but also to 2 test, but a test would be more long been friends! In general, the root directory is configured to 1, the other to test the filesystem are configured as two just fine.

<Opts> common parameters:

  • noatime Close atime features to improve performance, which is a very old features, ease close, but also reduce loadcycle
  • defaultsUse the default settings. Equal rw, suid, dev, exec, auto, nouser, async, see the specific meaning explained below.
  • Automatic and manual loading:
    autoautomatically mounted at startup or in the terminal mount -a input
    noautodevice (partition) can be manually mounted
  • Read and write permissions:
    romounted read-only permission
    rwmounted as read-write access
  • Executable:
    execis a default settings, it makes binary executable files in that partition can execute
    noexecbinary file is not allowed. Never in your root partition using this option! ! !
  • I / O synchronization:
    syncAll I / O will be synchronized manner
    asyncall the I / O will be performed asynchronously
  • Household mount privileges:
    userallows any user to mount devices. Implies noexec, nosuid, nodev unless overridden .
    nouserOnly allow the root user to mount. This is the default setting.
  • Temporary file execution permission:
    suid. Permit The Operation of suid, and sgid bits They are Mostly Used to the allow Users ON A Computer System to Execute binary executables with temporarily. It is, elevated privileges in Order to Perform A specific Task (. Permit suid and sgid bit operating they are used primarily to allow users on the computer system to execute binary executables with temporary elevated privileges to perform specific tasks. )
  • nosuidBlocks the operation of suid, and sgid bits. ( Blocking action suid and sgid bits. )

Reboot the system

Reboot the system, or in a terminal mount -acan see the effect of the modification.

Guess you like

Origin www.cnblogs.com/augusite/p/10930793.html