| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 | 
							- <?xml version="1.0" encoding="UTF-8"?>
 
- <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 
-   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
 
-   <!ENTITY % general-entities SYSTEM "../general.ent">
 
-   %general-entities;
 
- ]>
 
- <sect1 id="ch-bootable-fstab">
 
-   <?dbhtml filename="fstab.html"?>
 
-   <title>创建 /etc/fstab 文件</title>
 
-   <indexterm zone="ch-bootable-fstab">
 
-     <primary sortas="e-/etc/fstab">/etc/fstab</primary>
 
-   </indexterm>
 
-   <!--para>The <filename>/etc/fstab</filename> file is used by some programs to
 
-   determine where file systems are to be mounted by default, in which order, and
 
-   which must be checked (for integrity errors) prior to mounting. Create a new
 
-   file systems table like this:</para-->
 
-   <para>一些程序使用 <filename>/etc/fstab</filename> 文件,
 
- 	  以确定哪些文件系统是默认挂载的,和它们应该按什么顺序挂载,
 
- 	  以及哪些文件系统在挂载前必须被检查(确定是否有完整性错误)。
 
- 	  参考以下命令,创建一个新的文件系统表:</para>
 
- <screen revision="sysv"><userinput>cat > /etc/fstab << "EOF"
 
- <literal># Begin /etc/fstab
 
- # 文件系统     挂载点       类型     选项                转储  检查
 
- #                                                              顺序
 
- /dev/<replaceable><xxx></replaceable>     /            <replaceable><fff></replaceable>    defaults            1     1
 
- /dev/<replaceable><yyy></replaceable>     swap         swap     pri=1               0     0
 
- proc           /proc        proc     nosuid,noexec,nodev 0     0
 
- sysfs          /sys         sysfs    nosuid,noexec,nodev 0     0
 
- devpts         /dev/pts     devpts   gid=5,mode=620      0     0
 
- tmpfs          /run         tmpfs    defaults            0     0
 
- devtmpfs       /dev         devtmpfs mode=0755,nosuid    0     0
 
- # End /etc/fstab</literal>
 
- EOF</userinput></screen>
 
- <screen revision="systemd"><userinput>cat > /etc/fstab << "EOF"
 
- <literal># Begin /etc/fstab
 
- # 文件系统     挂载点       类型     选项                转储  检查
 
- #                                                              顺序
 
- /dev/<replaceable><xxx></replaceable>     /            <replaceable><fff></replaceable>    defaults            1     1
 
- /dev/<replaceable><yyy></replaceable>     swap         swap     pri=1               0     0
 
- # End /etc/fstab</literal>
 
- EOF</userinput></screen>
 
-   <para>将 <replaceable><xxx></replaceable>、
 
-   <replaceable><yyy></replaceable> 和 <replaceable><fff></replaceable>
 
-   替换为适用于您的系统的值,例如 <filename
 
-   class="partition">sda2</filename>、<filename
 
-   class="partition">sda5</filename> 和 <systemitem
 
-   class="filesystem">ext4</systemitem>。
 
-   参阅 <command>man 5 fstab</command> 了解该文件中 6 个域的详细信息。</para>
 
-   <!--para>Filesystems with MS-DOS or Windows origin (i.e.: vfat, ntfs, smbfs, cifs,
 
-   iso9660, udf) need the <quote>iocharset</quote> mount option in order for
 
-   non-ASCII characters in file names to be interpreted properly. The value
 
-   of this option should be the same as the character set of your locale,
 
-   adjusted in such a way that the kernel understands it. This works if the
 
-   relevant character set definition (found under File systems ->
 
-   Native Language Support) has been compiled into the kernel
 
-   or built as a module. The <quote>codepage</quote> option is also needed for
 
-   vfat and smbfs filesystems. It should be set to the codepage number used
 
-   under MS-DOS in your country. E.g., in order to mount USB flash drives, a
 
-   ru_RU.KOI8-R user would need the following in the options portion of its
 
-   mount line in <filename>/etc/fstab</filename>:</para-->
 
-   <para>在挂载来源于 MS-DOS 或 Windows 的文件系统
 
- 	  (如 vfat、ntfs、smbfs、cifs、iso9660、udf)时,
 
- 	  需要指定 <quote>iocharset</quote> 挂载选项,
 
- 	  才能正常解析文件名中的非 ASCII 字符。该选项的值应该和您的 locale
 
- 	  字符集设定一致,但改写成内核可以识别的写法。
 
- 	  该选项能够正常工作的前提是,将相关的字符集定义(在内核配置选项的
 
- 	  File Systems -> Native Language Support 子菜单中)
 
- 	  编译到内核中,或构建为内核模块。另外,
 
- 	  vfat 和 smbfs 文件系统还需要 <quote>codepage</quote> 选项,
 
- 	  它应该被设定为您的语言在 MS-DOS 下的代码页编号。
 
- 	  例如,为了挂载一个 USB 闪存盘,一个 ru_RU.KOI8-R 用户应该在
 
- 	  <filename>/etc/fstab</filename> 中对应于闪存盘的行添加下列挂载选项:
 
-   </para>
 
- <screen><literal>noauto,user,quiet,showexec,iocharset=koi8r,codepage=866</literal></screen>
 
-   <para>相应的,ru_RU.UTF-8 用户应该使用下列选项:</para>
 
- <screen><literal>noauto,user,quiet,showexec,iocharset=utf8,codepage=866</literal></screen>
 
-   <note>
 
-     <para>在后一种情况下,内核将会输出下列信息:</para>
 
- <screen><computeroutput>FAT: utf8 is not a recommended IO charset for FAT filesystems,
 
-     filesystem will be case sensitive!</computeroutput></screen>
 
-     <para>翻译为:</para>
 
- <screen><computeroutput>FAT: 不推荐使用 utf8 作为 FAT 文件系统的输入输出字符集,
 
-     这会导致文件系统变得大小写敏感!</computeroutput></screen>
 
-     <para>这项警告信息应该被忽略,因为其他
 
-     <quote>iocharset</quote> 值在 UTF-8 locale 下无法正确显示文件名。</para>
 
-   </note>
 
-   <note><title>译注</title>
 
- 	  <para>经译者实测,对于 UTF-8 locale 来说,应该用
 
- 		  <quote>utf8</quote> 选项代替 <quote>iocharset=utf8</quote>,
 
- 		  后者确实会导致文件名变得大小写不敏感(即文件 <quote>囧A</quote>
 
- 		  和 <quote>囧a</quote> 可以同时存在)。例如,对于 zh_CN.UTF-8
 
- 		  用户来说,应该使用的挂载选项是
 
- <screen><literal>noauto,user,quiet,showexec,utf8,codepage=936</literal></screen>
 
- 	  </para>
 
-   </note>
 
-   <!--para>It is also possible to specify default codepage and iocharset values for
 
-   some filesystems during kernel configuration. The relevant parameters
 
-   are named
 
-   <quote>Default NLS Option</quote> (<option>CONFIG_NLS_DEFAULT)</option>,
 
-   <quote>Default Remote NLS Option</quote> (<option>CONFIG_SMB_NLS_DEFAULT</option>),
 
-   <quote>Default codepage for FAT</quote> (<option>CONFIG_FAT_DEFAULT_CODEPAGE</option>), and
 
-   <quote>Default iocharset for FAT</quote> (<option>CONFIG_FAT_DEFAULT_IOCHARSET</option>).
 
-   There is no way to specify these settings for the
 
-   ntfs filesystem at kernel compilation time.</para-->
 
-   <para>也可以在内核配置中,
 
- 	  为一些文件系统指定默认 codepage 和 iocharset 选项值。
 
- 	  相关的配置参数名为
 
- 	  <quote>Default NLS Option</quote>
 
- 	  (<option>CONFIG_NLS_DEFAULT</option>)、
 
- 	  <quote>Default Remote NLS Option</quote>
 
- 	  (<option>CONFIG_SMB_NLS_DEFAULT</option>)、
 
- 	  <quote>Default codepage for FAT</quote>
 
- 	  (<option>CONFIG_FAT_DEFAULT_CODEPAGE</option>)
 
- 	  和 <quote>Default iocharset for FAT</quote>
 
- 	  (<option>CONFIG_FAT_DEFAULT_IOCHARSET</option>)。
 
- 	  无法在编译内核时为 ntfs 文件系统指定这些默认值。
 
-   </para>
 
-   <!--para>It is possible to make the ext3 filesystem reliable across power
 
-   failures for some hard disk types.  To do this, add the
 
-   <option>barrier=1</option> mount option to the appropriate entry in
 
-   <filename>/etc/fstab</filename>.  To check if the disk drive supports
 
-   this option, run
 
-   <ulink url="&blfs-book;general/hdparm.html">hdparm</ulink>
 
-   on the applicable disk drive.  For example, if:</para-->
 
-   <para>在某些硬盘上,在 <filename>/etc/fstab</filename> 中添加
 
- 	  <option>barrier=1</option> 挂载选项,
 
- 	  可以使得 ext3 文件系统在发生电源故障时更可靠。
 
- 	  为了检查磁盘驱动器是否支持该选项,在可用的磁盘驱动器上运行
 
- 	  <ulink url="&blfs-book;general/hdparm.html">hdparm</ulink>。
 
- 	  例如:</para>
 
- <screen role="nodump"><userinput>hdparm -I /dev/sda | grep NCQ</userinput></screen>
 
-   <para>如果输出内容不为空,说明该选项可用。</para>
 
-   <para>注意:基于逻辑卷管理(LVM)的分区不能使用
 
-   <option>barrier</option> 选项。</para>
 
- </sect1>
 
 
  |