Familiar with linux core configuration files fstab
Source: Internet
Author: User
Familiar with linux core configuration file fstab-Linux Enterprise Application-Linux server application information. The following is a detailed description. To make good use of linux, you must be familiar with some core configuration files of linux. Therefore, we have organized a series of articles to introduce the related information of these files.
The Fstab file stores information about the file system.
This file describes information about various file systems in the system. Generally, an application only reads this file and does not write the file. Maintenance is the work of the system administrator. In this file, each file system is described in one line. In each line, fields are separated by spaces or tabs. Lines starting with * in the file are comments. Sorting records in Fstab files is very important. Because programs such as fsck, mount, and umount perform their work in this order.
The first field is the definition of the file system (fs spec), which describes the block device or remote file system to be loaded. For a general mount operation, this field should include the device node of the block device to be loaded (created using the mknod command) or a connection pointing to such nodes (such as/dev/cdrom or/dev/sdb). For NFS mount operations, this field should contain information in the host: dir format, such as knuth. aeb. nl:/. For the process File System procfs, use proc.
In addition to the displayed device name, you can use the UUID of the device or the volume label of the device. For example, you can write "LABAL = root" or "UUID = 3e6be9de-8139-11d1-9106-a43f08d823a6 ", this will make the system more scalable. For example, if your system adds or removes a SCSI hard disk, this may change your device name, but it will not change your volume tag.
Each two fields (fs file) describes the loading point of the file system. For swap partition (swap), this field is defined as none. If the path of the loading point contains a space character, the space character can be replaced by "% content % 40.
The third field, fs vfstype, is used to define the type of the file system. Linux supports a large number of file types, including sdfs, affs, autofs, jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs, etc. If you want to know which file systems your kernel currently supports, you can view the/proc/filesystems content. If this field is defined as swap, this record is associated with a file or partition for the purpose of exchange. If this field is defined as ignored, this row will be ignored. This is very useful for displaying partitions that are not currently in use.
For every four fields, the file system option (fs mntops) is used to load the file system. Multiple options are separated by commas. The list of these options includes the loading type and other loading options suitable for the file system. For mounting options available for non-NFS systems, see the description of the mount command. For nfs system options, see the nfs documentation. Noauto is applicable to all file systems (when mount? Command a does not load), user (allow users to load), owner (allow device owners to load), _ netdev (the device requires a network), and the last two options are unique to linux.
The fifth field, file system frequency (fs_freq), is used by the dump program to determine which file system requires dump. If the last field is not set, the system considers the value 0, the dump program assumes that the file system does not require dump.
The first field (fs_passno) is used by The fsck program to determine the sequence of checking the file system during system restart. The value of Root System/should be set to 1, other file systems can be set to 2. file systems on the same physical hard disk should be checked sequentially, while file systems on different hard disks should also be checked to make full use of system parallelism. If the last field value is 0 or is not set, The fsck program skips the detection of this file system. In linux programming, you can use the getmntent process to access the content of this file.
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.