Understanding of / etc / fstab

File role

Avoid manually remounting the disk partition every time after booting. This file will be read when the system is started and mounted according to the configuration content

Mounting considerations

  1. The root file system must be mounted first
  2. Mount point must exist
  3. Mount device and mount point can only be mounted once at the same time

File content interpretation

[root@master ~]# cat /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Sat Jun 29 08:50:28 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=0bbd5e50-606c-4c47-8cd7-1ae67f812437 /                       xfs     defaults        0 0
UUID=bba2c917-8540-41c8-97e6-f1d73d9143ba /boot                   xfs     defaults        0 0
UUID=1c0f8351-49f0-4dd8-9a8b-1aff1d4a77b0 swap                    swap    defaults        0 0
UUID=6cfbe843-e280-4d85-9ae3-60b0ebcc5909 /data xfs defaults 0 0

The first column is the mounted device

  Can be the device name or UUID or label

Use the blkid command to view the UUID and device name

[root@master ~]# blkid /dev/sda3
/dev/sda3: UUID="0bbd5e50-606c-4c47-8cd7-1ae67f812437" TYPE="xfs" 

Note: the difference between mounting using device name and UUID

  When using the device name ( / dev / sda) to mount the partition, it is fixed. Once the order of the disk slots changes, there will be a problem that the names do not correspond. Because the name will change. If you use uuid to mount, you do n’t have to worry about messing up.

The second column is the mount point

  Is the directory that provides access to the device

The third column is the mount type

  Common file system types are: ext2-4, xfs nfs

The fourth column is the mounting parameters

Async/sync

Set whether to run in synchronous mode, the default is async

auto / noauto 

 When downloading the mount -a  command, is this file system actively mounted? The default is auto

rw/ro        

 Whether to mount in read-only or read-write mode

exec/noexec        

 Whether the restriction can be performed within this file system " execution " of operations

user/nouser

Whether to allow users to mount using the mount command

south / north

Whether to allow the existence of SUID

Usrquota

The boot file system supports disk quota mode

Grpquota

Enable file system support for group disk quota mode

Defaults

Colleagues have settings for default parameters such as rw , suid, dev, exec, auto, nouser, async, etc.

The parameter noatime can be optimized. When the defaults parameter is used, the time stamp is recorded when the file is accessed, created, or modified. For applications that require throughput, it is best to add this parameter, which will significantly improve I / O efficiency.

The fifth column is whether to backup

 0

Do not make dump backup

  1

On behalf of the daily dump operation

   2

On behalf of the date of the dump operation

The sixth column is whether to perform disk test

0

Don't test

1

The earliest inspection (general root directory will be selected)

2

Carry out inspection after completion of level 1 inspection

Guess you like

Origin www.cnblogs.com/zh-dream/p/12683403.html