此内容没有您所选择的语言版本。

5.9.5. Mounting File Systems Automatically with /etc/fstab


When a Red Hat Enterprise Linux system is newly-installed, all the disk partitions defined and/or created during the installation are configured to be automatically mounted whenever the system boots. However, what happens when additional disk drives are added to a system after the installation is done? The answer is "nothing" because the system was not configured to mount them automatically. However, this is easily changed.
The answer lies in the /etc/fstab file. This file is used to control what file systems are mounted when the system boots, as well as to supply default values for other file systems that may be mounted manually from time to time. Here is a sample /etc/fstab file:
 LABEL=/ / ext3 defaults 1 1 /dev/sda1 /boot ext3 defaults 1 2 /dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0 /dev/homedisk /home ext3 defaults 1 2 /dev/sda2 swap swap defaults 0 0 
Each line represents one file system and contains the following fields:
  • File system specifier -- For disk-based file systems, either a device file name (/dev/sda1), a file system label specification (LABEL=/), or a devlabel-managed symbolic link (/dev/homedisk)
  • Mount point -- Except for swap partitions, this field specifies the mount point to be used when the file system is mounted (/boot)
  • File system type -- The type of file system present on the specified device (note that auto may be specified to select automatic detection of the file system to be mounted, which is handy for removable media units such as diskette drives)
  • Mount options -- A comma-separated list of options that can be used to control mount's behavior (noauto,owner,kudzu)
  • Dump frequency -- If the dump backup utility is used, the number in this field controls dump's handling of the specified file system
  • File system check order -- Controls the order in which the file system checker fsck checks the integrity of the file systems
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.