MFen 1.265 -> 1.267.

Obtained from:	The FreeBSD Simplified Chinese Project
This commit is contained in:
Xin LI 2006-11-17 14:49:50 +00:00
parent ecb506f3d1
commit a45470d814
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=29103

View file

@ -2,7 +2,7 @@
The FreeBSD Documentation Project The FreeBSD Documentation Project
The FreeBSD Simplified Chinese Project The FreeBSD Simplified Chinese Project
Original Revision: 1.265 Original Revision: 1.267
$FreeBSD$ $FreeBSD$
--> -->
@ -1029,15 +1029,14 @@ scsibus1:
<sect2 id="imaging-cd"> <sect2 id="imaging-cd">
<title>复制数据 CD</title> <title>复制数据 CD</title>
<para>您可以把数据 CD 复制成一个与之等价的镜像文件, <para>您可以把数据 CD 复制成一个与之等价的映像文件,
镜像文件可以使用 可以使用 &man.mkisofs.8; 创建这种文件,
&man.mkisofs.8; 创建,您可以使用这个工具复制 或使用它来复制任何数据 CD。 这里给出的例子假定您的 CDROM
任何数据 CD。这里给出的例子假定您的 CDROM
设备是 <devicename>acd0</devicename> 您应将其替换为您实际使用的 CDROM 设备。</para> 设备是 <devicename>acd0</devicename> 您应将其替换为您实际使用的 CDROM 设备。</para>
<screen>&prompt.root; <userinput>dd if=/dev/acd0 of=file.iso bs=2048</userinput></screen> <screen>&prompt.root; <userinput>dd if=/dev/acd0 of=file.iso bs=2048</userinput></screen>
<para>现在您有一个像文件了,您可以像上面描述的那样把它刻录成 CD。 <para>现在您有一个像文件了,您可以像上面描述的那样把它刻录成 CD。
</para> </para>
</sect2> </sect2>
@ -2524,7 +2523,7 @@ echo "The floppy has been unmounted and is now ready."]]></programlisting>
</author> </author>
</authorgroup> </authorgroup>
</sect1info> </sect1info>
<title>网络、内存和 File-Backed 文件系统</title> <title>网络、内存和 和以及映像文件为介质的虚拟文件系统</title>
<indexterm><primary>virtual disks</primary></indexterm> <indexterm><primary>virtual disks</primary></indexterm>
<indexterm> <indexterm>
<primary>磁盘</primary> <primary>磁盘</primary>
@ -2541,22 +2540,22 @@ echo "The floppy has been unmounted and is now ready."]]></programlisting>
<primary>disks</primary> <primary>disks</primary>
<secondary>memory</secondary> <secondary>memory</secondary>
</indexterm> </indexterm>
<para>这还包括网络文件系统,例如 <link <para>这还包括 如 <link
linkend="network-nfs">Network File System</link> 和 Coda, 基于内存的 linkend="network-nfs">网络文件系统 (Network File System)</link> 和 Coda一类的网络文件系统、
文件系统和后备文件系统。</para> 内存以及映像文件为介质的虚拟文件系统。</para>
<para>按照你运行的 FreeBSD 版本,你可以使用不同的工具来创建和使用 <para>随运行的 FreeBSD 版本不同,
后备文件系统和内存文件系统。</para> 用来创建和使用以映像文件介质文件系统和内存文件系统的工具也不尽相同。</para>
<note> <note>
<para>系统会使用 &man.devfs.5; 来创建设备节点, 这对用户来说是透明的。</para> <para>系统会使用 &man.devfs.5; 来创建设备节点, 这对用户来说是透明的。</para>
</note> </note>
<sect2 id="disks-mdconfig"> <sect2 id="disks-mdconfig">
<title>采用文件后端的文件系统</title> <title>以映像文件为介质的文件系统</title>
<indexterm> <indexterm>
<primary>disks (磁盘)</primary> <primary>disks (磁盘)</primary>
<secondary>file-backed (采用文件作为后端)</secondary> <secondary>file-backed (采用文件作为介质)</secondary>
</indexterm> </indexterm>
<para>在 FreeBSD 系统中, 可以用 &man.mdconfig.8; <para>在 FreeBSD 系统中, 可以用 &man.mdconfig.8;
@ -2565,24 +2564,24 @@ echo "The floppy has been unmounted and is now ready."]]></programlisting>
<programlisting>device md</programlisting> <programlisting>device md</programlisting>
<para> &man.mdconfig.8; 命令支持三种类型的内存后备虚拟磁盘 <para> &man.mdconfig.8; 命令支持三种类型的虚拟文件系统
使用 &man.malloc.9;,来分配内存磁盘,内存磁盘作为文件或作为 使用 &man.malloc.9;,来分配内存文件系统,内存文件系统作为文件或作为
备用的交换分区。一种使用方式是在文件中来挂一个软盘和 备用的交换分区。一种使用方式是在文件中来挂一个软盘和
CD 像。</para> CD 像。</para>
<para>挂接一个存在的文件系统映像</para> <para>将一个暨存的映像文件作为文件系统挂载</para>
<example> <example>
<title>使用 <command>mdconfig</command> 挂载已经存在的文件系统映像</title> <title>使用 <command>mdconfig</command> 挂载已经存在的映像文件</title>
<screen>&prompt.root; <userinput>mdconfig -a -t vnode -f <replaceable>diskimage</replaceable> -u <replaceable>0</replaceable></userinput> <screen>&prompt.root; <userinput>mdconfig -a -t vnode -f <replaceable>diskimage</replaceable> -u <replaceable>0</replaceable></userinput>
&prompt.root; <userinput>mount /dev/md<replaceable>0</replaceable> <replaceable>/mnt</replaceable></userinput></screen> &prompt.root; <userinput>mount /dev/md<replaceable>0</replaceable> <replaceable>/mnt</replaceable></userinput></screen>
</example> </example>
<para>使用 &man.mdconfig.8; 来创建一个新的文件系统映像:</para> <para>使用 &man.mdconfig.8; 来创建新的映像文件:</para>
<example> <example>
<title>使用 <command>mdconfig</command> 创建一个新的文件后援磁盘</title> <title>使用 <command>mdconfig</command> 将映像文件作为文件系统挂载</title>
<screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>newimage</replaceable> bs=1k count=<replaceable>5</replaceable>k</userinput> <screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>newimage</replaceable> bs=1k count=<replaceable>5</replaceable>k</userinput>
5120+0 records in 5120+0 records in
@ -2600,23 +2599,23 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/md0a 4710 4 4330 0% /mnt</screen> /dev/md0a 4710 4 4330 0% /mnt</screen>
</example> </example>
<para>如果你没有使用 <option>-u</option> 选项指定一个单位 <para>如果没有通过 <option>-u</option> 选项指定一个标识
&man.mdconfig.8; 将使用 &man.mdconfig.8; 将使用
&man.md.4; 自动为它选择一个未使用的设备。 &man.md.4; 为它自动选择一个未用的设备标识号
分配给它的单位名将被输出到标准输出设备像 分配给它的标识名将被输出到标准输出设备, 其形式是与
<devicename>md4</devicename>。想得到更多的关于 <devicename>md4</devicename> 类似。 如果希望了解更多相关信息, 请参见联机手册
&man.mdconfig.8; 的信息请参考联机手册。</para> &man.mdconfig.8;。</para>
<para>应用程序 &man.mdconfig.8; 功能很强大, <para>&man.mdconfig.8; 功能很强大,
但在创建采用文件后端的文件系统时需要使用许多多行命令。 为此 但在将映像文件作为文件系统挂载时, 仍需使用许多行的命令。 为此
FreeBSD 也提供了一个名为 &man.mdmfs.8; 的工具, 该程序使用 FreeBSD 也提供了一个名为 &man.mdmfs.8; 的工具, 该程序使用
&man.mdconfig.8; 来配置 &man.md.4; 盘, 并在其上 &man.mdconfig.8; 来配置 &man.md.4; 设备, 并
&man.newfs.8; 创建 UFS 文件系统, 然后用 &man.mount.8; 挂接它。 例如, &man.newfs.8; 在其上创建 UFS 文件系统, 然后用 &man.mount.8; 来完成挂载操作。 例如,
如果想创建和挂接像上面那样的文件系统映像, 如果想创建和挂接像上面那样的文件系统映像,
只需简单地执行下面的步骤:</para> 只需简单地执行下面的步骤:</para>
<example> <example>
<title>使用 <command>mdmfs</command> 命令配置和挂接一个 File-Backed 磁盘</title> <title>使用 <command>mdmfs</command> 命令配置和挂载一个映像文件为文件系统</title>
<screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>newimage</replaceable> bs=1k count=<replaceable>5</replaceable>k</userinput> <screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>newimage</replaceable> bs=1k count=<replaceable>5</replaceable>k</userinput>
5120+0 records in 5120+0 records in
5120+0 records out 5120+0 records out
@ -2626,31 +2625,31 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/md0 4718 4 4338 0% /mnt</screen> /dev/md0 4718 4 4338 0% /mnt</screen>
</example> </example>
<para>如果你使用没有加单位号的 <option>md</option> 选项, <para>如果你使用没有加标识号的 <option>md</option> 选项,
&man.mdmfs.8; 将使用 &man.md.4; 的自动单位号特性来自动为其 &man.mdmfs.8; 将使用 &man.md.4; 的自动标示号特性来自动为其
选择一个未使用的设备。更详细的 选择一个未使用的设备。更详细的
&man.mdmfs.8;,请参考联机手册。</para> &man.mdmfs.8;,请参考联机手册。</para>
</sect2> </sect2>
<sect2 id="disks-md-freebsd5"> <sect2 id="disks-md-freebsd5">
<title>以内存为后端的文件系统</title> <title>以内存为介质的文件系统</title>
<indexterm> <indexterm>
<primary>disks (磁盘)</primary> <primary>disks (磁盘)</primary>
<secondary>内存文件系统</secondary> <secondary>内存文件系统</secondary>
</indexterm> </indexterm>
<para>一般来说, 在建立以内存为后端的文件系统时, 应使用 <quote>交换区作为后端 <para>一般来说, 在建立以内存为介质的文件系统时, 应使用 <quote>交换区作为介质
(swap backing)</quote>。 使用交换区作为后端 (swap backing)</quote>。 使用交换区作为介质
并不意味着内存盘将被无条件地换出到交换区, 并不意味着内存盘将被无条件地换出到交换区,
它只是表示将根据需要从可换出的内存池中分配内存。 它只是表示将根据需要从可换出的内存池中分配内存。
此外, 也可以使用 此外, 也可以使用
&man.malloc.9; 作为后端的内存盘, 但这种内存盘在内核内存不足时, &man.malloc.9; 创建以内存作为介质的文件系统。
有可能会导致系统崩溃。</para> 不过在内存不足时, 这种方式可能引致系统崩溃。</para>
<example> <example>
<title>用 <command>mdconfig</command> <title>用 <command>mdconfig</command>
创建一个新的内存后备磁盘</title> 创建新的内存盘设备</title>
<screen>&prompt.root; <userinput>mdconfig -a -t swap -s <replaceable>5</replaceable>m -u <replaceable>1</replaceable></userinput> <screen>&prompt.root; <userinput>mdconfig -a -t swap -s <replaceable>5</replaceable>m -u <replaceable>1</replaceable></userinput>
&prompt.root; <userinput>newfs -U md<replaceable>1</replaceable></userinput> &prompt.root; <userinput>newfs -U md<replaceable>1</replaceable></userinput>
@ -2666,7 +2665,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
</example> </example>
<example> <example>
<title>使用 <command>mdmfs</command> 来新建内存</title> <title>使用 <command>mdmfs</command> 来新建内存介质文件系统</title>
<screen>&prompt.root; <userinput>mdmfs -s <replaceable>5</replaceable>m md<replaceable>2</replaceable> <replaceable>/mnt</replaceable></userinput> <screen>&prompt.root; <userinput>mdmfs -s <replaceable>5</replaceable>m md<replaceable>2</replaceable> <replaceable>/mnt</replaceable></userinput>
&prompt.root; <userinput>df <replaceable>/mnt</replaceable></userinput> &prompt.root; <userinput>df <replaceable>/mnt</replaceable></userinput>
Filesystem 1K-blocks Used Avail Capacity Mounted on Filesystem 1K-blocks Used Avail Capacity Mounted on
@ -2675,15 +2674,15 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on
</sect2> </sect2>
<sect2> <sect2>
<title>从系统中移除内存盘</title> <title>从系统中移除内存盘设备</title>
<indexterm> <indexterm>
<primary>磁盘</primary> <primary>磁盘</primary>
<secondary>移除内存盘</secondary> <secondary>移除内存盘设备</secondary>
</indexterm> </indexterm>
<para>当采用内存作为后端的文件系统不再使用时, 应将资源释放回系统。 <para>当不再使用内存盘设备时, 应将资源释放回系统。
第一步操作是卸下文件系统, 然后使用 第一步操作是卸下文件系统, 然后使用
&man.mdconfig.8; 把磁盘从系统中分离, 以释放资源。</para> &man.mdconfig.8; 把虚拟磁盘从系统中分离, 以释放资源。</para>
<para>例如, 要分离并释放所有 <para>例如, 要分离并释放所有
<filename>/dev/md4</filename> 使用的资源, 应使用命令:</para> <filename>/dev/md4</filename> 使用的资源, 应使用命令:</para>
@ -3046,6 +3045,17 @@ Password:</screen>
<para>重新引导进入新的内核。</para> <para>重新引导进入新的内核。</para>
</step> </step>
<step>
<para>另一种无需重新编译内核的方法, 是使用
<command>kldload</command> 来加载 &man.gbde.4;</para>
<screen>&prompt.root; <userinput>kldload geom_bde</userinput></screen>
<para>目前, 尚没有可以写到
<filename>/boot/loader.conf</filename>
中, 以便在系统引导时自动加载这个模块的选项。</para>
</step>
</procedure> </procedure>
<sect3> <sect3>
@ -3248,7 +3258,7 @@ Filesystem Size Used Avail Capacity Mounted on
因而, 我们建议这类脚本在控制台或通过 &man.ssh.1; 因而, 我们建议这类脚本在控制台或通过 &man.ssh.1;
执行并要求用户输入口令。</para> 执行并要求用户输入口令。</para>
<para>从 &os; 5.2-RELEASE 开始, 提供了一个新的 <filename>rc.d</filename> 脚本。 <para>除此之外, 系统还提供了一个 <filename>rc.d</filename> 脚本。
这个脚本的参数可以通过 这个脚本的参数可以通过
&man.rc.conf.5; 来指定, 例如:</para> &man.rc.conf.5; 来指定, 例如:</para>