1. the fstab file is stored in the file system information in the/etc/fstab file. When the file is correctly set, you can use the mount/directoryname command to load a file system. each file system corresponds to an independent line, fields in each row are separated by spaces or tabs. Both fsck, mount, umount and other commands
1. functions of the fstab file
File/etc/fstab stores the file system information in the system. When the file is correctly set, you can run the "mount/directoryname" command to load a file system. each file system corresponds to an independent line, fields in each row are separated by spaces or tabs. At the same time, fsck, mount, umount and other commands all use this program.
2. fstab file format
The following is an example line of the/etc/fatab file:
Fs_spec fs_file fs_type fs_options fs_dump fs_pass
/Dev/hda1/ext2 defaults 1 1
Fs_spec-this field defines the device or remote file system where the file system to be loaded is located. for general local block devices, the IDE device is generally described as/dev/hdaXN, X is the IDE device channel (a, B, orc). N represents the partition number. SCSI device 1 is described as/dev/sdaXN. For NFS, the format is generally :
For example, 'knuth. aeb. nl :/'. For procfs, use 'proc' for definition.
Fs_file-this field describes the directory point to be loaded by the file system. for a swap device, this field is none. for a directory name containing spaces, 40 is used to indicate spaces.
Fs_type-defines the file system on the device. the common file types are ext2 (common file types for linux devices) and vfat (fat32 format for Windows systems), NTFS, iso9600, etc.
Fs_options-specifying the file system to load the device is a specific parameter option that needs to be used, multiple parameters are separated by commas. Most systems can use "defaults" 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
Fs_dump-This option is used by the "dump" command to check how often a file system should be dumped. If no dump is required, set this field to 0.
Fs_pass-this field is used by the fsck command to determine the sequence of the file system to be scanned at startup. The value of the "/" pair of the root file system should be 1, other file systems should be 2. If the file system does not need to scan at startup, set this field to 0.
3. Sample file
#/Etc/fstab
/Dev/hda9 swap defaults 0 0
/Dev/hda1/ext2 defaults 1 1
/Dev/hda5/home ext2 defaults 1 1
/Dev/hda6/usr ext2 defaults 1 1
/Dev/hda7/usr/local ext2 defaults 1 1
/Dev/hda8/var ext2 defaults 1 1
/Dev/hdb/cdrom iso9660 noauto, user 0 0
None/proc defaults 0 0
None/dev/pts devpts gid = 5, mode = 620 0 0