Linux boot mount (disk) __linux

Source: Internet
Author: User

After the system is added to the disk, if you reboot the system we will find that the store is not found, but using fdisk-l can see the storage space, indicating that the store is still there. This is because the mount has been automatically unloaded after the shutdown. We can, of course, mount it manually again, but it would be inconvenient to do this manually every reboot, so we can use automatic mounting so that the system can automatically mount the disk each time it is powered on.

There are two ways to mount a mount automatically.

1. Modify the/etc/fstab file

Using VIM to open the Fstab file, you can see the file format as follows:

# #
/etc/fstab #
Created by Anaconda on Tue Oct 11:50:19 2015 # Accessible filesystems, by
Reference, are maintained under '/dev/disk '
# The man pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info
#
  /dev/mapper/vg_minimal-logvol00/                       ext4    defaults        1 1
uuid=f8066e4a-e1df-4815-9d6e-c74a6811ba5e /boot                   ext4    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc/                    proc                   proc    defaults        0 0
It's obvious to see that there are 6 columns in the file.

The 1th column is the device name or volume label

The 2nd column is the mount point (that is, the Mount directory)

The 3rd column is the file system or file system type on which you want to mount the device

The 4th column is mount options, usually using defaults to

The 5th column sets whether a dump backup is used, 0 is not backed up, the 1,2 is backup, but 2 is less important than 1

The 6th column is set whether the disk that is mounted on the fsck test is used when the machine is powered on, the 0 is not inspected, the 1,2 is tested, but 2 disk is compared to 1 of the disk late inspection.


This article will need to mount the logical volume Lv_study to/lvm_study, the file system is EXT4 format, no dump backup and power-on disk check.

/dev/mapper/vg_study-lv_study  /lvm_study        ext4    defaults        0 0
After adding the above command to Fstab, we can use the MOUNT-A command to verify that the contents of the edits are wrong in order to avoid possible errors. After executing the mount-a command, using Df-h to see that the disk has been mounted successfully, indicating that there is no error in the input. The system can be mounted automatically the next time you reboot.

The example diagram looks like this:



Note: (1) The root directory must take precedence over other mount points

(2) The mount point must be a directory that already exists

(3) The uninstall must ensure that the current disk does not have read and write operations

2. Modify the/etc/rc.d/rc.local file

Adding the Mount command to the rc.local file is another way to achieve automatic power-on mounting

Mount/dev/mapper/vg_study-lv_study/lvm_study



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.