Linux Learning-/etc/fstab File detailed

Source: Internet
Author: User

Directory

  • /etc/fstab Introduction

  • Parameter introduction

  • Some issues with configuring this file

First, Introduction

Before you introduce/etc/fstab, you need to understand the relationship between the mount and the file:

In fact, Windows also need to be mounted, but in the partition when Windows was "mounted" to the c,d,e and other disks.

After any hardware device is connected, the operating system uses hardware, which is required to mount. Windows is simply "mounted", and Linux needs to be done manually. Under the Linux system, for example, each time you mount a/dev/sr0 (CD-ROM device file), you need to manually use the command mount. Of course, each reboot, when turned on, the hard disk is usually automatically mounted, and automatically mount the information is recorded in the/etc/fstab file.

Each time the system starts, it reads the configuration in/etc/fstab and automatically mounts the recorded devices and partitions in the file.

The contents of/etc/fstab are as follows:

[[email protected] ~]# vim /etc/fstab ## /etc/fstab# created by  Anaconda on tue jan  9 04:49:39 2018## 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= 4bd3dfe3-6be8-4971-b9bf-f8cd4d7a0c6c /                        ext4    defaults         1 1uuid=909d7582-281c-4415-b679-8968e518821b /app                      ext4    defaults        1 2uuid= 051c003c-2cef-4115-bc1c-525759174a77 /boot                    ext4    defaults        1  2UUID=b530db70-89ec-454d-96df-ad291205804f swap                     swap    defaults         0 0tmpfs                    /dev/shm                 tmpfs   defaults         0 0devpts                   /dev/pts                 devpts  gid=5,mode=620  0 0sysfs                    /sys                     sysfs    defaults        0 0proc                     /proc                    proc     defaults        0 0/dev/sr0                 /media/dvd1              iso9660 defaults         0 0~                                                                                                 ~                                                                                                ~                                                                                                   "/etc/fstab"  17l, 975c

Second, the parameter introduction

There are six column parameters in the file:

first column: Device file or UUID or label ( the difference between the three see below )

second column: The device's mount point ( Empty Directory )

The third column: The format of the partition file system ( The partition format can be automatically identified by using the special parameter auto. )

Fourth column: File system parameters, formatting options

column Fifth: Settings for dump backup ( 0 means no dump backup, 1 for dump backup per day, 2 for dump backup on an indefinite date )

Sixth column: Disk check settings ( is actually a check order, 0 is not checked, 1 represents the first check, 2 follow up. The general root directory is 1, the same number is checked at the same time )

Iii. Some issues with configuring this file

Ways to view the label and UUID of a device file: (dumpe2fs blkid)

[[Email protected] ~] #dumpe2fs-H/dev/sda1

You can view the UUID and label for the SDA1 partition (more information)

[Email protected] ~]# blkid/dev/sr0/dev/sr0:label= "centos_6.9_final" type= "iso9660"

Device files, UUID, and label are different as identities:

The use of the device file name will be in effect at the moment, may occur after the system restarts the problem;

The label will also take effect after the system restarts, but pay attention to the label of the device in real time;

The UUID is the unique identity of the partition.

Fourth column parameter list:







Linux Learning-/etc/fstab File detailed

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.