|
@@ -1,4 +1,4 @@
|
|
-<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
@@ -8,16 +8,20 @@
|
|
<sect1 id="ch-bootable-fstab">
|
|
<sect1 id="ch-bootable-fstab">
|
|
<?dbhtml filename="fstab.html"?>
|
|
<?dbhtml filename="fstab.html"?>
|
|
|
|
|
|
- <title>Creating the /etc/fstab File</title>
|
|
|
|
|
|
+ <title>创建 /etc/fstab 文件</title>
|
|
|
|
|
|
<indexterm zone="ch-bootable-fstab">
|
|
<indexterm zone="ch-bootable-fstab">
|
|
<primary sortas="e-/etc/fstab">/etc/fstab</primary>
|
|
<primary sortas="e-/etc/fstab">/etc/fstab</primary>
|
|
</indexterm>
|
|
</indexterm>
|
|
|
|
|
|
- <para>The <filename>/etc/fstab</filename> file is used by some programs to
|
|
|
|
|
|
+ <!--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
|
|
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
|
|
which must be checked (for integrity errors) prior to mounting. Create a new
|
|
- file systems table like this:</para>
|
|
|
|
|
|
+ file systems table like this:</para-->
|
|
|
|
+ <para>一些程序使用 <filename>/etc/fstab</filename> 文件,
|
|
|
|
+ 以确定哪些文件系统是默认挂载的,和它们应该按什么顺序挂载,
|
|
|
|
+ 以及哪些文件系统在挂载前必须被检查(确定是否有完整性错误)。
|
|
|
|
+ 参考以下命令,创建一个新的文件系统表:</para>
|
|
|
|
|
|
<screen revision="sysv"><userinput>cat > /etc/fstab << "EOF"
|
|
<screen revision="sysv"><userinput>cat > /etc/fstab << "EOF"
|
|
<literal># Begin /etc/fstab
|
|
<literal># Begin /etc/fstab
|
|
@@ -48,15 +52,15 @@ EOF</userinput></screen>
|
|
# End /etc/fstab</literal>
|
|
# End /etc/fstab</literal>
|
|
EOF</userinput></screen>
|
|
EOF</userinput></screen>
|
|
|
|
|
|
- <para>Replace <replaceable><xxx></replaceable>,
|
|
|
|
- <replaceable><yyy></replaceable>, and <replaceable><fff></replaceable>
|
|
|
|
- with the values appropriate for the system, for example, <filename
|
|
|
|
- class="partition">sda2</filename>, <filename
|
|
|
|
- class="partition">sda5</filename>, and <systemitem
|
|
|
|
- class="filesystem">ext4</systemitem>. For details on the six
|
|
|
|
- fields in this file, see <command>man 5 fstab</command>.</para>
|
|
|
|
|
|
+ <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,
|
|
|
|
|
|
+ <!--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
|
|
iso9660, udf) need the <quote>iocharset</quote> mount option in order for
|
|
non-ASCII characters in file names to be interpreted properly. The value
|
|
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,
|
|
of this option should be the same as the character set of your locale,
|
|
@@ -67,26 +71,52 @@ EOF</userinput></screen>
|
|
vfat and smbfs filesystems. It should be set to the codepage number used
|
|
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
|
|
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
|
|
ru_RU.KOI8-R user would need the following in the options portion of its
|
|
- mount line in <filename>/etc/fstab</filename>:</para>
|
|
|
|
|
|
+ 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>
|
|
<screen><literal>noauto,user,quiet,showexec,iocharset=koi8r,codepage=866</literal></screen>
|
|
|
|
|
|
- <para>The corresponding options fragment for ru_RU.UTF-8 users is:</para>
|
|
|
|
|
|
+ <para>相应的,ru_RU.UTF-8 用户应该使用下列选项:</para>
|
|
|
|
|
|
<screen><literal>noauto,user,quiet,showexec,iocharset=utf8,codepage=866</literal></screen>
|
|
<screen><literal>noauto,user,quiet,showexec,iocharset=utf8,codepage=866</literal></screen>
|
|
|
|
|
|
<note>
|
|
<note>
|
|
- <para>In the latter case, the kernel emits the following message:</para>
|
|
|
|
|
|
+ <para>在后一种情况下,内核将会输出下列信息:</para>
|
|
|
|
|
|
<screen><computeroutput>FAT: utf8 is not a recommended IO charset for FAT filesystems,
|
|
<screen><computeroutput>FAT: utf8 is not a recommended IO charset for FAT filesystems,
|
|
filesystem will be case sensitive!</computeroutput></screen>
|
|
filesystem will be case sensitive!</computeroutput></screen>
|
|
|
|
|
|
- <para>This negative recommendation should be ignored, since all other values
|
|
|
|
- of the <quote>iocharset</quote> option result in wrong display of filenames in
|
|
|
|
- UTF-8 locales.</para>
|
|
|
|
|
|
+ <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>
|
|
</note>
|
|
|
|
|
|
- <para>It is also possible to specify default codepage and iocharset values for
|
|
|
|
|
|
+ <!--para>It is also possible to specify default codepage and iocharset values for
|
|
some filesystems during kernel configuration. The relevant parameters
|
|
some filesystems during kernel configuration. The relevant parameters
|
|
are named
|
|
are named
|
|
<quote>Default NLS Option</quote> (<option>CONFIG_NLS_DEFAULT)</option>,
|
|
<quote>Default NLS Option</quote> (<option>CONFIG_NLS_DEFAULT)</option>,
|
|
@@ -94,21 +124,40 @@ EOF</userinput></screen>
|
|
<quote>Default codepage for FAT</quote> (<option>CONFIG_FAT_DEFAULT_CODEPAGE</option>), and
|
|
<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>).
|
|
<quote>Default iocharset for FAT</quote> (<option>CONFIG_FAT_DEFAULT_IOCHARSET</option>).
|
|
There is no way to specify these settings for the
|
|
There is no way to specify these settings for the
|
|
- ntfs filesystem at kernel compilation time.</para>
|
|
|
|
-
|
|
|
|
- <para>It is possible to make the ext3 filesystem reliable across power
|
|
|
|
|
|
+ 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
|
|
failures for some hard disk types. To do this, add the
|
|
<option>barrier=1</option> mount option to the appropriate entry in
|
|
<option>barrier=1</option> mount option to the appropriate entry in
|
|
<filename>/etc/fstab</filename>. To check if the disk drive supports
|
|
<filename>/etc/fstab</filename>. To check if the disk drive supports
|
|
this option, run
|
|
this option, run
|
|
<ulink url="&blfs-book;general/hdparm.html">hdparm</ulink>
|
|
<ulink url="&blfs-book;general/hdparm.html">hdparm</ulink>
|
|
- on the applicable disk drive. For example, if:</para>
|
|
|
|
|
|
+ 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>
|
|
<screen role="nodump"><userinput>hdparm -I /dev/sda | grep NCQ</userinput></screen>
|
|
|
|
|
|
- <para>returns non-empty output, the option is supported.</para>
|
|
|
|
|
|
+ <para>如果输出内容不为空,说明该选项可用。</para>
|
|
|
|
|
|
- <para>Note: Logical Volume Management (LVM) based partitions cannot use the
|
|
|
|
- <option>barrier</option> option.</para>
|
|
|
|
|
|
+ <para>注意:基于逻辑卷管理(LVM)的分区不能使用
|
|
|
|
+ <option>barrier</option> 选项。</para>
|
|
|
|
|
|
</sect1>
|
|
</sect1>
|