Use of fstab configuration files in Linux

Source: Internet
Author: User
We have a fSTab file under the/etc/directory in Linux. what is the role of this file? In fact, this file stores information about the file system in the system. When the file is correctly set, we can load a file system by running the mount/arbitrary directory command. for example, if we add a new hard disk partition, we will

We have a fSTab file under the/etc/directory in Linux. what is the role of this file?

In fact, this file stores information about the file system in the system. When the file is correctly set, we can load a file system using the mount/arbitrary directory command. for example, if we add a new hard disk partition, we can add the following command:

/Dev/sdb1/mnt/mydisk ext2 default 0 0

If we use a USB device, add the following line:

Usbfs/proc/bus/usb usbfs defaults 0 0

However, the above USB example can only work when you compile the related support into the kernel.

Now let's talk about the meaning of the above parameters.

The comment in/etc/fstab is as follows:

File system is the source to be mounted.

Mount point is the directory to which we want to mount

Type is the type hanging on the system, such as vfat, ext3, tmpfs, sysfs, and so on.

Options specifies that the file system to load the device is a specific parameter option, multiple parameters are separated by commas. Most systems can use ULTS to meet their needs. Other common options include:

Option description

Ro loads the file system in read-only mode

Sync does not buffer write operations on the device, which can prevent file system damage during abnormal shutdown, but reduces the computer speed.

User allows normal users to load the file system

Quota forces disk quota limit on this file system

Noauto no longer uses the mount-a command (for example, when the system is started) to load the file system

Dump

In Linux, you can use the dump command to back up the system. The dump command sets/etc/fstab to select whether to back up the partition! 0 indicates that dump backup is not performed, and 1 indicates that dump is performed. 2 also means to do the dump backup action, but the importance of the partition is smaller than 1.

Pass

During the boot process, the system uses fSCK to check whether the filesystem in our partition is complete (clean ). However, some filesystems do not need to be tested, such as virtual memory swap or special file systems, such as/proc and/sys. Therefore, in this field, we can set whether to use fsck to check the filesystem. 0 is not to test, 1 is to test, 2 is to test, but 1 will be checked earlier! Generally, set the root directory to 1, and set all other filesystems to 2.

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.