Linux boot automatically mount the disk - based fstab file

Personal blog home page (Click for more details) - https://blog.51cto.com/11495268
Personal Public Number (click on the link scan code concern oh) - https://blog.51cto.com/11495268/2401194
    

1 Introduction

    Boot automatically mount very useful, especially when many turned from start service depends on certain data files; described herein, edit / etc / fstab boot from Kai
    

2、/etc/fstab

# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda3 during installation
UUID=4dfee257-e6a1-41fb-b16a-1d93a7ebe0be /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=9008bfed-4aa5-44d9-9a2d-58d4ffd0fcaf /boot           ext4    defaults        0       2
# swap was on /dev/sda5 during installation
UUID=9255b841-8bde-4878-afe4-ad7e118f132b none            swap    sw              0       0

UUID=c87a3ad3-d319-4621-bf08-14013281bbe7 /mnt/learn_linux ext4 defaults 0 0

    

3. Detailed contents

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# 要挂载的设备或伪文件系统  挂载点  文件系统类型  挂载选项 转储频率 自检次序

    

3.1 device or a pseudo file system

    Device files, LABEL (LABEL = "") , UUID (UUID = "")
    pseudo file system name (proc, sysfs)
    

3.2 mount point

    Specified folder

3.3 Mount options

    defaults

3.4 Frequency dump

    Using the automatic backup partition data dump command frequency
        0: not backing
        1: Dump day
        2: Transfer every other day
    

3.5 self-test order

    0: No Self-Test
    1: First, the self-test
    

4, extension (difference / etc / fstab and / etc / mtab) of

Role 4.1 / etc / fstab file

    Records the information on a computer hard disk partition, Linux boot time, check the partition of the fsck command and mount the partition mount command, you need the information in the fstab to mount the hard drive and check the correct
    

Role 4.2 / etc / mtab file

    Whenever mount to mount the partition, umount unmount the partition will dynamically update mtab, mtab always maintained partition information for the current system mounted

Guess you like

Origin blog.51cto.com/11495268/2402305