Set automatic mount of hard disk partitions when Linux is started

Source: Internet
Author: User
1. the/etc/fstab file describes how to configure the/etc/fstab file for automatic mount in Linux. This file is used to store static information of the file system. When the Linux system starts, it automatically reads information from the file and completes the Mount task of the specified file system. The following describes how to enter information under this file. This file contains six parameters: 1./etc/fstab
In Linux, the/etc/fstab file must be configured for automatic mount. This file is used to store static information of the file system. When the Linux system starts, it automatically reads information from the file and completes the Mount task of the specified file system.
The following describes how to enter information under this file.
There are six parameters to configure in this file:, and :,,,,,. The following describes the meanings of these six domains in detail.

1) : Specifies the device name, block information, or remote file system of the file system to be mounted. For example, NFS/192.168.1.56:/home/nfs/, local device/dev/sdc1,/dev/cdrom. In addition, it can be represented by a label (volume label) or UUID (UniversallyUnique Identifier globally unique Identifier.
* Before using label, e2label is required to create a volume label, for example, e2label/dir_1/dir_2, which means/dir_2 is used to represent the name of/dir_1. Then, add LABEL =/dir_2/dir_2 under/etc/fstab as follows: . After the restart, the system will mount/dir_1 to the/dir_2 directory.
* For UUID, you can use blkid-o value-s UUID/dev/sdxx to obtain it. For example, if you want to mount the first 11th partitions of the first hard disk, run the command blkid-o value-s UUID/dev/sda11 to obtain the UUID, for example, 5dc08a62-4262-471b-9ef5-0a91e5e2c126. Enter UUID = 5dc08a62-4872-471b-9ef5-0a91e5e2c126 in this field to indicate/dev/sda11. Red Hatlinux generally uses label, while Ubuntu linux generally uses UUID.

2) : Mount point. For swap partitions, enter none in this field, indicating that no mount point exists.
3) : Indicates the file system type. Currently, Linux supports the following types: adfs, befs, cifs, ext3, ext2, ext, iso9660, kafs, minix, msdos, vfat, umsdos, proc, reiserfs, swap, squashfs, nfs, hpfs, ncpfs, ntfs, affs and ufs.
4) : Set options. each option is separated by commas (,). you can use the man mount command to view the specific content. The common values are: rw ults, which indicates that the options rw, suid, dev, exec, auto, nouser, and async are included.
5) : Optional value: 0 or 1. specifies whether to back up data. If this parameter is set to 1 If the value is 0, the backup is not performed. Currently, dump is rarely used. Select 0 here.
6) : The optional value is 0 or an integer that specifies how to use fsck to check the hard disk. Enter 0, no check; if the mount point is/(that is, the root partition), you must enter 1 here, and none of the other can be entered 1. If the number of partitions is greater than 1, after checking the root partition, check the number from small to large. Check the number at the same time.

2.LvsSet hareplex to auto Mount upon startup
Vi/etc/fstab
/Dev/nfsvg/lvshareplex/shareplex/ext3 defaults 0 0

Related Article

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.