diff options
Diffstat (limited to 'zh_CN.GB2312/books/handbook/disks/chapter.xml')
-rw-r--r-- | zh_CN.GB2312/books/handbook/disks/chapter.xml | 656 |
1 files changed, 271 insertions, 385 deletions
diff --git a/zh_CN.GB2312/books/handbook/disks/chapter.xml b/zh_CN.GB2312/books/handbook/disks/chapter.xml index 2038e9b711..476ccd1578 100644 --- a/zh_CN.GB2312/books/handbook/disks/chapter.xml +++ b/zh_CN.GB2312/books/handbook/disks/chapter.xml @@ -6,11 +6,10 @@ Original Revision: 1.309 $FreeBSD$ --> - -<chapter id="disks"> +<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="disks"> <title>存储</title> - <sect1 id="disks-synopsis"> + <sect1 xml:id="disks-synopsis"> <title>概述</title> @@ -61,12 +60,12 @@ </sect1> - <sect1 id="disks-naming"> + <sect1 xml:id="disks-naming"> <title>设备命名</title> <para>下面是在 FreeBSD 上被支持的物理存储设备和它们被分配的设备名。</para> - <table id="disk-naming-physical-table" frame="none"> + <table xml:id="disk-naming-physical-table" frame="none"> <title>物理磁盘命名规则</title> <tgroup cols="2"> @@ -129,19 +128,15 @@ </table> </sect1> - <sect1 id="disks-adding"> - <sect1info> + <sect1 xml:id="disks-adding"> + <info><title>添加磁盘</title> <authorgroup> - <author> - <firstname>David</firstname> - <surname>O'Brien</surname> - <contrib>Originally contributed by </contrib> - </author> + <author><personname><firstname>David</firstname><surname>O'Brien</surname></personname><contrib>Originally contributed by </contrib></author> </authorgroup> - <!-- 26 Apr 1998 --> - </sect1info> + + </info> - <title>添加磁盘</title> + <indexterm> <primary>磁盘</primary> @@ -153,11 +148,11 @@ 需要关掉计算机,然后按操作规程来安装驱动器,控制器和驱动程序。由于 各厂家生产的产品各不相同,具体的安装细节不在此文档介绍之内。</para> - <para>以 <username>root</username> 用户登录。安装完驱动后,检查一下 + <para>以 <systemitem class="username">root</systemitem> 用户登录。安装完驱动后,检查一下 <filename>/var/run/dmesg.boot</filename> 有没有找到新的磁盘。在我们 - 的例子中新增加的磁盘就是 <devicename>da1</devicename>,我们从 + 的例子中新增加的磁盘就是 <filename>da1</filename>,我们从 <filename>/1</filename> 挂上它。 (如果您正添加 IDE 驱动器, - 则设备名应该是 <devicename>ad1</devicename>)。</para> + 则设备名应该是 <filename>ad1</filename>)。</para> <indexterm><primary> partitions</primary></indexterm> @@ -206,7 +201,7 @@ <para>您可以使用 <command>sysinstall</command> 命令的菜单来分区和标记一个新的磁盘。 这一操作需要有 root 权限, - 您可以直接使用 <username>root</username> 账户登录或者使用 + 您可以直接使用 <systemitem class="username">root</systemitem> 账户登录或者使用 <command>su</command> 命令来切换到 root 用户。运行 <command>sysinstall</command> ,然后选择 <literal>Configure</literal> 菜单。在 @@ -316,31 +311,23 @@ </sect2> </sect1> - <sect1 id="raid"> + <sect1 xml:id="raid"> <title>RAID</title> - <sect2 id="raid-soft"> + <sect2 xml:id="raid-soft"> <title>软件 RAID</title> - <sect3 id="ccd"> - <sect3info> + <sect3 xml:id="ccd"> + <info><title>连接磁盘驱动器配置 (CCD) </title> <authorgroup> - <author> - <firstname>Christopher</firstname> - <surname>Shumway</surname> - <contrib>Original work by </contrib> - </author> + <author><personname><firstname>Christopher</firstname><surname>Shumway</surname></personname><contrib>Original work by </contrib></author> </authorgroup> <authorgroup> - <author> - <firstname>Jim</firstname> - <surname>Brown</surname> - <contrib>Revised by </contrib> - </author> + <author><personname><firstname>Jim</firstname><surname>Brown</surname></personname><contrib>Revised by </contrib></author> </authorgroup> - </sect3info> + </info> - <title>连接磁盘驱动器配置 (CCD) </title> + <indexterm><primary>RAID</primary><secondary>software</secondary></indexterm> <indexterm> @@ -362,7 +349,7 @@ 如果您的需求更偏重于速度和性能,那么您的解决方案将就不同于上面的设计。 </para> - <sect4 id="ccd-installhw"> + <sect4 xml:id="ccd-installhw"> <title>安装硬件</title> <para>除了 IDE 系统磁盘外,还有三个 Western Digital 30GB、5400 RPM @@ -382,12 +369,11 @@ ad3: 29333MB <WDC WD307AA> [59598/16/63] at ata1-slave UDMA33</programlist <emphasis>不是</emphasis> 设置 master/slave 硬盘的跳线。查阅文档 信息来确定正确的跳线设置。</para></note> - <para>接下来考虑的是,如何创建文件系统。应该好好研究一下 &man.vinum.4; (<xref - linkend="vinum-vinum"/>)和 &man.ccd.4; 两种方式,在这里我们选择 &man.ccd.4; + <para>接下来考虑的是,如何创建文件系统。应该好好研究一下 &man.vinum.4; (<xref linkend="vinum-vinum"/>)和 &man.ccd.4; 两种方式,在这里我们选择 &man.ccd.4; </para> </sect4> - <sect4 id="ccd-setup"> + <sect4 xml:id="ccd-setup"> <title>安装 CCD</title> <para>&man.ccd.4; 允许用户将几个相同的的磁盘通过一个逻辑文件系统 @@ -404,8 +390,8 @@ ad3: 29333MB <WDC WD307AA> [59598/16/63] at ata1-slave UDMA33</programlist bsdlabel -w ad2 auto bsdlabel -w ad3 auto</programlisting> - <para>此处将整个硬盘创建为 <devicename>ad1c</devicename>, <devicename>ad2c</devicename> - 和 <devicename>ad3c</devicename>。</para> + <para>此处将整个硬盘创建为 <filename>ad1c</filename>, <filename>ad2c</filename> + 和 <filename>ad3c</filename>。</para> <para>下一步是改变 disklable 的类型。也可以使用 &man.bsdlabel.8; 来编辑:</para> @@ -433,13 +419,13 @@ bsdlabel -e ad3</programlisting> </sect4> - <sect4 id="ccd-buildingfs"> + <sect4 xml:id="ccd-buildingfs"> <title>建立文件系统</title> <para>现在已给每个磁盘都加上了标签,下面需要建立 &man.ccd.4;。要这样做, 需要使用 &man.ccdconfig.8; 工具,同时要提供类似下面的选项:</para> - <programlisting>ccdconfig ccd0<co id="co-ccd-dev"/> 32<co id="co-ccd-interleave"/> 0<co id="co-ccd-flags"/> /dev/ad1e<co id="co-ccd-devs"/> /dev/ad2e /dev/ad3e</programlisting> + <programlisting>ccdconfig ccd0<co xml:id="co-ccd-dev"/> 32<co xml:id="co-ccd-interleave"/> 0<co xml:id="co-ccd-flags"/> /dev/ad1e<co xml:id="co-ccd-devs"/> /dev/ad2e /dev/ad3e</programlisting> <para>每个选项的意义和用法如下所示:</para> @@ -477,7 +463,7 @@ bsdlabel -e ad3</programlisting> </sect4> - <sect4 id="ccd-auto"> + <sect4 xml:id="ccd-auto"> <title>自动创建</title> <para>最后,要挂上 &man.ccd.4; ,需要先配置它。把当前的配置文件写入 @@ -503,7 +489,7 @@ bsdlabel -e ad3</programlisting> </sect4> </sect3> - <sect3 id="vinum"> + <sect3 xml:id="vinum"> <title> Vinum 卷管理</title> <indexterm><primary>RAID</primary><secondary>software</secondary></indexterm> @@ -522,7 +508,7 @@ bsdlabel -e ad3</programlisting> </sect3> </sect2> - <sect2 id="raid-hard"> + <sect2 xml:id="raid-hard"> <title>硬件 RAID</title> <indexterm> @@ -633,19 +619,15 @@ ar0: ATA RAID1 subdisks: ad4 ad6 status: REBUILDING 0% completed</screen> </sect2> </sect1> - <sect1 id="usb-disks"> - <sect1info> + <sect1 xml:id="usb-disks"> + <info><title>USB 存储设备</title> <authorgroup> - <author> - <firstname>Marc</firstname> - <surname>Fonvieille</surname> - <contrib>Contributed by </contrib> - </author> + <author><personname><firstname>Marc</firstname><surname>Fonvieille</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> - <!-- Jul 2004 --> - </sect1info> + + </info> - <title>USB 存储设备</title> + <indexterm> <primary>USB</primary> <secondary>disks</secondary> @@ -706,7 +688,7 @@ da0: 1.000MB/s transfers da0: 126MB (258048 512 byte sectors: 64H 32S/T 126C)</screen> <para>当然啦,商标,设备标识 - (<devicename>da0</devicename>) 和其它的细节信息会根据您的配置不同 + (<filename>da0</filename>) 和其它的细节信息会根据您的配置不同 而有所不同。</para> <para>因为 USB 设备被看作 SCSI 设备中的一个, @@ -729,9 +711,9 @@ da0: 126MB (258048 512 byte sectors: 64H 32S/T 126C)</screen> <para>如果希望设备能够被普通用户挂接, 还需要做一些其它操作。 首先, 在 USB 存储设备连接到计算机上时, 系统自动生成的设备文件, 必须是该用户能够读写的。 - 一种做法是让所有属于 <groupname>operator</groupname> 组的用户都可以访问该设备。 + 一种做法是让所有属于 <systemitem class="groupname">operator</systemitem> 组的用户都可以访问该设备。 要完成这项工作, 首先需要用 &man.pw.8; 来给用户指定组。 其次, - 在生成设备文件时, <groupname>operator</groupname> 组应能读写它们。 这可以通过在 + 在生成设备文件时, <systemitem class="groupname">operator</systemitem> 组应能读写它们。 这可以通过在 <filename>/etc/devfs.rules</filename> 中增加一些相应的设置来实现:</para> <programlisting>[localrules=5] @@ -739,12 +721,12 @@ add path 'da*' mode 0660 group operator</programlisting> <note> <para>如果系统中已经有其它 SCSI 磁盘, 则上述操作必须做一些变化。 - 例如, 如果系统中已经存在了设备名为 <devicename>da0</devicename> 到 - <devicename>da2</devicename> 的磁盘, 则第二行应改为:</para> + 例如, 如果系统中已经存在了设备名为 <filename>da0</filename> 到 + <filename>da2</filename> 的磁盘, 则第二行应改为:</para> <programlisting>add path 'da[3-9]*' mode 0660 group operator</programlisting> - <para>这会将系统中已经存在的磁盘, 排除在属于 <groupname>operator</groupname> + <para>这会将系统中已经存在的磁盘, 排除在属于 <systemitem class="groupname">operator</systemitem> 组的设备之外。</para> </note> @@ -764,19 +746,19 @@ add path 'da*' mode 0660 group operator</programlisting> <para>最后一步是创建将要挂接文件系统的目录。 这个目录必须是属于将要挂接文件系统的用户的。 - 以 <username>root</username> 身份为用户建立属于该用户的 - <filename>/mnt/<replaceable>username</replaceable></filename> + 以 <systemitem class="username">root</systemitem> 身份为用户建立属于该用户的 + <filename>/mnt/username</filename> (此处 <replaceable>username</replaceable> 应替换成用户的登录名, 并把 <replaceable>usergroup</replaceable> 替换成用户所属的组):</para> - <screen>&prompt.root; <userinput>mkdir /mnt/<replaceable>username</replaceable></userinput> -&prompt.root; <userinput>chown <replaceable>username</replaceable>:<replaceable>usergroup</replaceable> /mnt/<replaceable>username</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>mkdir /mnt/username</userinput> +&prompt.root; <userinput>chown username:usergroup /mnt/username</userinput></screen> <para>假设已经插入了一个 USB 读卡设备, 并且系统将其识别为 <filename>/dev/da0s1</filename>, 由于这些设备通常是 FAT 文件系统, 用户可以这样挂接它们:</para> - <screen>&prompt.user; <userinput>mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt/<replaceable>username</replaceable></userinput></screen> + <screen>&prompt.user; <userinput>mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt/username</userinput></screen> <para>如果拔出设备 (必须首先将其对应的磁盘卷卸下), 则您会在系统消息缓冲区中看到类似下面的信息:</para> @@ -799,20 +781,15 @@ umass0: detached</screen> </sect2> </sect1> - <sect1 id="creating-cds"> - <sect1info> + <sect1 xml:id="creating-cds"> + <info><title>创建和使用光学介质(CD)</title> <authorgroup> - <author> - <firstname>Mike</firstname> - <surname>Meyer</surname> - <contrib>Contributed by </contrib> - <!-- mwm@mired.org --> - </author> + <author><personname><firstname>Mike</firstname><surname>Meyer</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> - <!-- Apr 2001 --> - </sect1info> + + </info> - <title>创建和使用光学介质(CD)</title> + <indexterm> <primary>CDROMs</primary> <secondary>creating</secondary> @@ -840,9 +817,9 @@ umass0: detached</screen> 而又能在不支持这些扩展的系统上正常使用。</para> <indexterm> - <primary><filename role="package">sysutils/cdrtools</filename></primary> + <primary><package>sysutils/cdrtools</package></primary> </indexterm> - <para><filename role="package">sysutils/</filename> + <para><package>sysutils/</package> port 包括了 &man.mkisofs.8;, 这是一个可以用来生成包含 ISO 9660 文件系统的数据文件的程序。 他也提供了对于一些扩展的支持选项,下面将详细介绍。</para> @@ -851,38 +828,32 @@ umass0: detached</screen> <secondary>ATAPI</secondary> </indexterm> <para>使用哪个工具来刻录 CD 取决于您的 CD 刻录机是 ATAPI 的, - 还是其他类型的。 对于 ATAPI CD 刻录机, 可以使用基本系统附带的 <command><link - linkend="burncd">burncd</link></command> 程序。 SCSI 和 USB CD + 还是其他类型的。 对于 ATAPI CD 刻录机, 可以使用基本系统附带的 <command>burncd</command> 程序。 SCSI 和 USB CD 刻录机, 则需要配合 - <command><link linkend="cdrecord">cdrecord</link></command> 程序使用, - 它可以通过 <filename role="package">sysutils/cdrtools</filename> port - 安装。 除此之外, 在 ATAPI 接口的刻录机上, 也可以配合 <link - linkend="atapicam">ATAPI/CAM 模块</link> 来使用 <command><link - linkend="cdrecord">cdrecord</link></command> 以及其它为 SCSI + <command>cdrecord</command> 程序使用, + 它可以通过 <package>sysutils/cdrtools</package> port + 安装。 除此之外, 在 ATAPI 接口的刻录机上, 也可以配合 <link linkend="atapicam">ATAPI/CAM 模块</link> 来使用 <command>cdrecord</command> 以及其它为 SCSI 刻录机撰写的工具。</para> <para>如果您想使用带图形界面的 CD 刻录软件, 可以考虑一下 <application>X-CD-Roast</application> 或 <application>K3b</application>。 这些工具可以通过使用预编译安装包, - 或通过 <filename - role="package">sysutils/xcdroast</filename> 和 <filename - role="package">sysutils/k3b</filename> ports 来安装。 + 或通过 <package>sysutils/xcdroast</package> 和 <package>sysutils/k3b</package> ports 来安装。 <application>X-CD-Roast</application> 和 - <application>K3b</application> 需要 <link - linkend="atapicam">ATAPI/CAM 模块</link> 配合 ATAPI + <application>K3b</application> 需要 <link linkend="atapicam">ATAPI/CAM 模块</link> 配合 ATAPI 硬件。</para> </sect2> - <sect2 id="mkisofs"> + <sect2 xml:id="mkisofs"> <title>mkisofs</title> <para>&man.mkisofs.8; 程序作为 - <filename role="package">sysutils/cdrtools</filename> port 的一部分, + <package>sysutils/cdrtools</package> port 的一部分, 将生成 ISO 9660 文件系统,其中包含 &unix; 命名空间中的文件名。 最简单的用法是:</para> - <screen>&prompt.root; <userinput>mkisofs -o <replaceable>imagefile.iso</replaceable> <replaceable>/path/to/tree</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>mkisofs -o imagefile.iso /path/to/tree</userinput></screen> <indexterm> <primary>文件系统</primary> @@ -931,7 +902,7 @@ umass0: detached</screen> <screen>&prompt.root; <userinput>mkisofs -R -no-emul-boot -b boot/cdboot -o /tmp/bootable.iso /tmp/myboot</userinput></screen> - <para>完成这些工作之后, 如果您的内核中配置了 <devicename>md</devicename>, + <para>完成这些工作之后, 如果您的内核中配置了 <filename>md</filename>, 就可以用下列命令来挂接文件系统了:</para> <screen>&prompt.root; <userinput>mdconfig -a -t vnode -f /tmp/bootable.iso -u 0</userinput> @@ -945,7 +916,7 @@ umass0: detached</screen> 和 HFS 格式的磁盘。查看 &man.mkisofs.8; 联机手册得到更多的帮助。</para> </sect2> - <sect2 id="burncd"> + <sect2 xml:id="burncd"> <title>burncd</title> <indexterm> <primary>CDROMs</primary> @@ -956,7 +927,7 @@ umass0: detached</screen> 系统的一部分,中以使用 <filename>/usr/sbin/burncd</filename> 来安装。 用法如下:</para> - <screen>&prompt.root; <userinput>burncd -f <replaceable>cddevice</replaceable> data <replaceable>imagefile.iso</replaceable> fixate</userinput></screen> + <screen>&prompt.root; <userinput>burncd -f cddevice data imagefile.iso fixate</userinput></screen> <para>在 <replaceable>cddevice</replaceable> 上刻录一份 <replaceable>imagefile.iso</replaceable> 的副本。 @@ -965,12 +936,12 @@ umass0: detached</screen> 请参考 &man.burncd.8; 以了解设置写入速度的参数,如何在刻录完成之后自动弹出CD,以及刻录音频数据。</para> </sect2> - <sect2 id="cdrecord"> + <sect2 xml:id="cdrecord"> <title>cdrecord</title> <para>如果没有一个 ATAPI CD 刻录机,必须使用 <command>cdrecord</command> 来刻录您的 CD 。 <command>cdrecord</command> 不是基本系统的一部分;必须 - 从 <filename role="package">sysutils/cdrtools</filename> 或适当的 + 从 <package>sysutils/cdrtools</package> 或适当的 package 安装它。基本系统的变化可能会引起这个程序的错误。可能是由 <quote>coaster</quote> 引起的。当升级系统时,同时需要升级 port, 或者如果您 <link linkend="stable">使用 -STABLE</link>, @@ -979,7 +950,7 @@ umass0: detached</screen> <para><command>cdrecord</command> 有许多选项,基本用法与 <command>burncd</command> 相似。刻录一个 ISO 9660 映像文件只需这样做:</para> - <screen>&prompt.root; <userinput>cdrecord dev=<replaceable>device</replaceable> <replaceable>imagefile.iso</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>cdrecord dev=device imagefile.iso</userinput></screen> <para>使用 <command>cdrecord</command> 的比较巧妙的方法是找到使用的 <option>dev</option> 。要找到正确的设置,可以使用 <command>cdrecord</command> @@ -1017,7 +988,7 @@ scsibus1: 的介绍了解有关音轨,控制速度和其他的东西。</para> </sect2> - <sect2 id="duplicating-audiocds"> + <sect2 xml:id="duplicating-audiocds"> <title>复制音频 CD</title> <para>您可以这样复制 CD,把 CD 上面的音频数据解压缩出一系列的文件, @@ -1038,7 +1009,7 @@ scsibus1: <para>使用 <command>cdrecord</command> 来写 <filename>.wav</filename> 文件。</para> - <screen>&prompt.user; <userinput>cdrecord -v dev=<replaceable>2,0</replaceable> -dao -useinfo *.wav</userinput></screen> + <screen>&prompt.user; <userinput>cdrecord -v dev=2,0 -dao -useinfo *.wav</userinput></screen> <para>确保 <replaceable>2,0</replaceable> 被适当地设置了, 具体方法在 <xref linkend="cdrecord"/> 中有所描述。</para> @@ -1057,7 +1028,7 @@ scsibus1: <step> <para>ATAPI CD 驱动用 - <filename>/dev/acd<replaceable>d</replaceable>t<replaceable>nn</replaceable></filename>表示每个轨道, + <filename>/dev/acddtnn</filename>表示每个轨道, 这里 <replaceable>d</replaceable> 是驱动器号, <replaceable>nn</replaceable> 是轨道号,由两位小数位组成,省略前缀零。 所以第一个盘片上的第一个轨道就是 @@ -1088,18 +1059,18 @@ scsibus1: 这些文件是音频文件,这样 <command>burncd</command> 会在刻录完成时 结束光盘。</para> - <screen>&prompt.root; <userinput>burncd -f <replaceable>/dev/acd0</replaceable> audio track1.cdr track2.cdr <replaceable>...</replaceable> fixate</userinput></screen> + <screen>&prompt.root; <userinput>burncd -f /dev/acd0 audio track1.cdr track2.cdr ... fixate</userinput></screen> </step> </procedure> </sect2> - <sect2 id="imaging-cd"> + <sect2 xml:id="imaging-cd"> <title>复制数据 CD</title> <para>您可以把数据 CD 复制成一个与之等价的映像文件, 可以使用 &man.mkisofs.8; 创建这种文件, 或使用它来复制任何数据 CD。 这里给出的例子假定您的 CDROM - 设备是 <devicename>acd0</devicename>, 您应将其替换为您实际使用的 CDROM 设备。</para> + 设备是 <filename>acd0</filename>, 您应将其替换为您实际使用的 CDROM 设备。</para> <screen>&prompt.root; <userinput>dd if=/dev/acd0 of=file.iso bs=2048</userinput></screen> @@ -1107,7 +1078,7 @@ scsibus1: </para> </sect2> - <sect2 id="mounting-cd"> + <sect2 xml:id="mounting-cd"> <title>使用数据 CD</title> <para>现在您已经创建了一张标准的数据 CDROM,您或许想要 @@ -1176,7 +1147,7 @@ scsibus1: 总线 reset 信号。</para> </sect2> - <sect2 id="rawdata-cd"> + <sect2 xml:id="rawdata-cd"> <title>刻录原始数据 CD</title> <para>您可以选择把一个文件目录刻录到 CD 上而不用 @@ -1197,18 +1168,14 @@ scsibus1: &man.mkisofs.8;。</para> </sect2> - <sect2 id="atapicam"> - <sect2info> + <sect2 xml:id="atapicam"> + <info><title>使用 ATAPI/CAM 驱动</title> <authorgroup> - <author> - <firstname>Marc</firstname> - <surname>Fonvieille</surname> - <contrib>Contributed by </contrib> - </author> + <author><personname><firstname>Marc</firstname><surname>Fonvieille</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> - </sect2info> + </info> - <title>使用 ATAPI/CAM 驱动</title> + <indexterm> <primary>CD burner</primary> @@ -1217,8 +1184,7 @@ scsibus1: <para>这个驱动允许 ATAPI 设备(CD-ROM, CD-RW, DVD 驱动器等...)通过 SCSI 子系统访问, - 这样允许使用像 <filename - role="package">sysutils/cdrdao</filename> 或者 + 这样允许使用像 <package>sysutils/cdrdao</package> 或者 &man.cdrecord.1; 这样的程序。</para> <para>要使用这个驱动, 您需要把下面这行添加到 <filename>/boot/loader.conf</filename> @@ -1259,9 +1225,9 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c 挂载 CD-ROM 到 <filename>/mnt</filename>,只需要键入下面的 命令:</para> - <screen>&prompt.root; <userinput>mount -t cd9660 <replaceable>/dev/cd0</replaceable> /mnt</userinput></screen> + <screen>&prompt.root; <userinput>mount -t cd9660 /dev/cd0 /mnt</userinput></screen> - <para>作为 <username>root</username>,您可以运行下面的 + <para>作为 <systemitem class="username">root</systemitem>,您可以运行下面的 命令来得到刻录机的 SCSI 地址:</para> <screen>&prompt.root; <userinput>camcontrol devlist</userinput> @@ -1276,26 +1242,18 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c </sect2> </sect1> - <sect1 id="creating-dvds"> - <sect1info> + <sect1 xml:id="creating-dvds"> + <info><title>创建和使用光学介质(DVD)</title> <authorgroup> - <author> - <firstname>Marc</firstname> - <surname>Fonvieille</surname> - <contrib>Contributed by </contrib> - </author> + <author><personname><firstname>Marc</firstname><surname>Fonvieille</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> <authorgroup> - <author> - <firstname>Andy</firstname> - <surname>Polyakov</surname> - <contrib>With inputs from </contrib> - </author> + <author><personname><firstname>Andy</firstname><surname>Polyakov</surname></personname><contrib>With inputs from </contrib></author> </authorgroup> - <!-- Feb 2004 --> - </sect1info> + + </info> - <title>创建和使用光学介质(DVD)</title> + <indexterm> <primary>DVD</primary> <secondary>burning</secondary> @@ -1312,8 +1270,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <itemizedlist> <listitem> <para>DVD-R:这是第一种可用的 DVD 可记录格式。 - DVD-R 标准由 <ulink - url="http://www.dvdforum.com/forum.shtml">DVD Forum</ulink> 定义。 + DVD-R 标准由 <link xlink:href="http://www.dvdforum.com/forum.shtml">DVD Forum</link> 定义。 这种格式是一次可写的。</para> </listitem> @@ -1335,8 +1292,8 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <listitem> <para>DVD+RW:这是一种由 - <ulink url="http://www.dvdrw.com/">DVD+RW - Alliance</ulink> 定义的可覆写格式。一张 DVD+RW 可以被覆写大约 1000 + <link xlink:href="http://www.dvdrw.com/">DVD+RW + Alliance</link> 定义的可覆写格式。一张 DVD+RW 可以被覆写大约 1000 次。</para> </listitem> @@ -1364,8 +1321,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>&man.growisofs.1; 将被用来实施 DVD 刻录。 这个命令是 - <application>dvd+rw-tools</application> 工具集 (<filename - role="package">sysutils/dvd+rw-tools</filename>) 的一部分。 + <application>dvd+rw-tools</application> 工具集 (<package>sysutils/dvd+rw-tools</package>) 的一部分。 <application>dvd+rw-tools</application> 支持所有的 DVD 介质类型。</para> <para>这些工具将使用 SCSI 子系统来访问设备,因此 @@ -1381,14 +1337,12 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>试图使用 <application>dvd+rw-tools</application> 之前您应该参考 - <ulink - url="http://fy.chalmers.se/~appro/linux/DVD+RW/hcn.html">dvd+rw-tools - 硬件兼容性列表</ulink> 是否有与您的 DVD 刻录机有关的信息。</para> + <link xlink:href="http://fy.chalmers.se/~appro/linux/DVD+RW/hcn.html">dvd+rw-tools + 硬件兼容性列表</link> 是否有与您的 DVD 刻录机有关的信息。</para> <note> <para>如果您想要一个图形化的用户界面,您应该看一看 - <application>K3b</application> (<filename - role="package">sysutils/k3b</filename>),它提供了 + <application>K3b</application> (<package>sysutils/k3b</package>),它提供了 &man.growisofs.1; 的一个友好界面和许多其他刻录工具。</para> </note> </sect2> @@ -1396,16 +1350,14 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <sect2> <title>刻录数据 DVD</title> - <para>&man.growisofs.1; 命令是 <link - linkend="mkisofs">mkisofs</link> 的前端,它会调用 + <para>&man.growisofs.1; 命令是 <link linkend="mkisofs">mkisofs</link> 的前端,它会调用 &man.mkisofs.8; 来创建文件系统布局,完成到 DVD 上的刻录。 这意味着您不需要在刻录之前创建数据映像。</para> - <para>要把 <filename - class="directory">/path/to/data</filename> 目录的数据刻录到 DVD+R + <para>要把 <filename>/path/to/data</filename> 目录的数据刻录到 DVD+R 或者 DVD-R 上面,使用下面的命令:</para> - <screen>&prompt.root; <userinput>growisofs -dvd-compat -Z <replaceable>/dev/cd0</replaceable> -J -R <replaceable>/path/to/data</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -dvd-compat -Z /dev/cd0 -J -R /path/to/data</userinput></screen> <para><option>-J -R</option> 选项传递给 &man.mkisofs.8; 用于文件系统创建 (这表示创建带有带有 @@ -1424,7 +1376,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c 例如记录一个映像文件 <replaceable>imagefile.iso</replaceable>, 我们可以运行:</para> - <screen>&prompt.root; <userinput>growisofs -dvd-compat -Z <replaceable>/dev/cd0</replaceable>=<replaceable>imagefile.iso</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -dvd-compat -Z /dev/cd0=imagefile.iso</userinput></screen> <para>刻录的速度可以被检测到并自动进行调整, 根据介质和驱动器的使用情况。如果您想强制改变速度, @@ -1444,20 +1396,19 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>要创建这样的 ISO 文件:</para> - <screen>&prompt.user; <userinput>mkisofs -R -J -udf -iso-level 3 -o <replaceable>imagefile.iso</replaceable> <replaceable>/path/to/data</replaceable></userinput></screen> + <screen>&prompt.user; <userinput>mkisofs -R -J -udf -iso-level 3 -o imagefile.iso /path/to/data</userinput></screen> <para>直接将文件刻录到光盘上:</para> - <screen>&prompt.root; <userinput>growisofs -dvd-compat -udf -iso-level 3 -Z <replaceable>/dev/cd0</replaceable> -J -R <replaceable>/path/to/data</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -dvd-compat -udf -iso-level 3 -Z /dev/cd0 -J -R /path/to/data</userinput></screen> <para>假如只是使用包含巨型文件的 ISO 映像文件时, 就不需要在运行 &man.growisofs.1; 来将映像文件刻录成光盘时指定任何额外的选项了。</para> <para>另外, 在映像文件中增加或直接刻录巨型文件时, 还需要注意使用最新的 - <filename role="package">sysutils/cdrtools</filename> (包含了 + <package>sysutils/cdrtools</package> (包含了 &man.mkisofs.8;), 因为旧版并不提供巨型文件支持。 如果您遇到问题, - 也可以尝试一下开发版本的软件包, 例如 <filename - role="package">sysutils/cdrtools-devel</filename> 并参阅 + 也可以尝试一下开发版本的软件包, 例如 <package>sysutils/cdrtools-devel</package> 并参阅 &man.mkisofs.8; 联机手册。</para> </note> </sect2> @@ -1473,17 +1424,16 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>DVD-Video 是一种特殊的基于 ISO 9660 和 micro-UDF (M-UDF) 规范的文件系统。 DVD-Video 也呈现了一个特殊的数据格式, - 这就是为什么您需要一个特殊的程序像 <filename - role="package">multimedia/dvdauthor</filename> 来制作 + 这就是为什么您需要一个特殊的程序像 <package>multimedia/dvdauthor</package> 来制作 DVD 的原因。</para> <para>如果您已经有了 DVD-Video 文件系统的映像, 就可以以同样的方式制作另一个映像,可以参看前面章节的例子。 如果您想制作 DVD 并想放在特定的目录中,如在目录 - <filename class="directory">/path/to/video</filename> 中, + <filename>/path/to/video</filename> 中, 可以使用下面的命令来刻录 DVD-Video:</para> - <screen>&prompt.root; <userinput>growisofs -Z <replaceable>/dev/cd0</replaceable> -dvd-video <replaceable>/path/to/video</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -Z /dev/cd0 -dvd-video /path/to/video</userinput></screen> <para> <option>-dvd-video</option> 选项将传递给 &man.mkisofs.8; 并指示它创建一个 DVD-Video 文件系统布局。 @@ -1505,7 +1455,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c 这是 <emphasis>recommended</emphasis> 的方式。您也可以使用 <command>dvd+rw-format</command> 来对 DVD+RW 进行格式化:</para> - <screen>&prompt.root; <userinput>dvd+rw-format <replaceable>/dev/cd0</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>dvd+rw-format /dev/cd0</userinput></screen> <para>您只需要执行这样的操作一次,牢记只有空白的 DVD+RW 介质才需要格式化。您可以以前面章节同样的方式来刻录 @@ -1516,7 +1466,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c 您只须要直接覆盖掉以前的记录即可。 (执行一个新的初始化对话), 像这样:</para> - <screen>&prompt.root; <userinput>growisofs -Z <replaceable>/dev/cd0</replaceable> -J -R <replaceable>/path/to/newdata</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -Z /dev/cd0 -J -R /path/to/newdata</userinput></screen> <para>DVD+RW 格式化程序为简单的向以前的记录追加数据提供了可能性。 这个操作有一个新的会话和一个已经存在的会话合并而成。 @@ -1527,7 +1477,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>例如,我们想追加一些数据到到我们以前的 DVD+RW 上,我们可以使用下面的命令:</para> - <screen>&prompt.root; <userinput>growisofs -M <replaceable>/dev/cd0</replaceable> -J -R <replaceable>/path/to/nextdata</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -M /dev/cd0 -J -R /path/to/nextdata</userinput></screen> <para>在以后的写操作时, 应使用与最初的刻录会话时相同的 &man.mkisofs.8; 选项。</para> @@ -1540,7 +1490,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>如果出于某种原因您真的想要空白介质盘, 可以执行下面的命令:</para> - <screen>&prompt.root; <userinput>growisofs -Z <replaceable>/dev/cd0</replaceable>=<replaceable>/dev/zero</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -Z /dev/cd0=/dev/zero</userinput></screen> </sect2> <sect2> @@ -1559,7 +1509,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>要格式化一张 DVD-RW 为顺序写入模式,运行:</para> - <screen>&prompt.root; <userinput>dvd+rw-format -blank=full <replaceable>/dev/cd0</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>dvd+rw-format -blank=full /dev/cd0</userinput></screen> <note> <para>一次完全的格式化 (<option>-blank=full</option>) @@ -1568,7 +1518,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c DVD-RW 要以 Disk-At-Once (DAO) 模式刻录的话。要以 DAO 模式刻录 DVD-RW,使用命令:</para> - <screen>&prompt.root; <userinput>growisofs -use-the-force-luke=dao -Z <replaceable>/dev/cd0</replaceable>=<replaceable>imagefile.iso</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -use-the-force-luke=dao -Z /dev/cd0=imagefile.iso</userinput></screen> <para><option>-use-the-force-luke=dao</option> 选项不是必需的, 因为 &man.growisofs.1; 试图最低限度的检测 (快速格式化) 介质并进行 @@ -1580,7 +1530,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>在一张顺序 DVD-RW 上写入数据,使用和其他 DVD 格式相同的指令:</para> - <screen>&prompt.root; <userinput>growisofs -Z <replaceable>/dev/cd0</replaceable> -J -R <replaceable>/path/to/data</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -Z /dev/cd0 -J -R /path/to/data</userinput></screen> <para>如果您想在您以前的刻录上附加数据,您必须使用 &man.growisofs.1; 的 <option>-M</option> 选项。然而, @@ -1596,11 +1546,11 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>要把 DVD-RW 置于受限式覆写格式, 必须使用下面的命令:</para> - <screen>&prompt.root; <userinput>dvd+rw-format <replaceable>/dev/cd0</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>dvd+rw-format /dev/cd0</userinput></screen> <para>更改回顺序写入模式使用:</para> - <screen>&prompt.root; <userinput>dvd+rw-format -blank=full <replaceable>/dev/cd0</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>dvd+rw-format -blank=full /dev/cd0</userinput></screen> </sect2> <sect2> @@ -1615,7 +1565,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c 一次初始化 (未关闭) 区段之后使用下面的命令, 将会在光盘上添加一个新的区段:</para> - <screen>&prompt.root; <userinput>growisofs -M <replaceable>/dev/cd0</replaceable> -J -R <replaceable>/path/to/nextdata</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>growisofs -M /dev/cd0 -J -R /path/to/nextdata</userinput></screen> <para>对 DVD+RW 或者 DVD-RW 在受限式覆写模式下使用这条命令, 会合并新区段到存在的区段中来附加数据。 @@ -1635,16 +1585,14 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>要获得更多的关于 DVD 的信息 <command>dvd+rw-mediainfo - <replaceable>/dev/cd0</replaceable></command> 命令可以运行来获得 + /dev/cd0</command> 命令可以运行来获得 更多的信息。</para> <para>更多的关于 <application>dvd+rw-tools</application> 的信息可以在 - &man.growisofs.1; 联机手册找到,在 <ulink - url="http://fy.chalmers.se/~appro/linux/DVD+RW/">dvd+rw-tools - web site</ulink> 和 <ulink - url="http://lists.debian.org/cdwrite/">cdwrite mailing - list</ulink> 联接中也可找到。</para> + &man.growisofs.1; 联机手册找到,在 <link xlink:href="http://fy.chalmers.se/~appro/linux/DVD+RW/">dvd+rw-tools + web site</link> 和 <link xlink:href="http://lists.debian.org/cdwrite/">cdwrite mailing + list</link> 联接中也可找到。</para> <note> <para><command>dvd+rw-mediainfo</command> 命令的输出结果记录, @@ -1653,7 +1601,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c </note> </sect2> - <sect2 id="creating-dvd-ram"> + <sect2 xml:id="creating-dvd-ram"> <title>使用 DVD-RAM</title> <indexterm> <primary>DVD</primary> @@ -1679,11 +1627,11 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c 首次使用它之前, 应首先 <quote>初始化</quote> DVD-RAM。 在下面的例子中, 我们将在全部空间上使用标准的 UFS2 文件系统:</para> - <screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>/dev/acd0</replaceable> bs=2k count=1</userinput> -&prompt.root; <userinput>bsdlabel -Bw <replaceable>acd0</replaceable></userinput> -&prompt.root; <userinput>newfs <replaceable>/dev/acd0</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>dd if=/dev/zero of=/dev/acd0 bs=2k count=1</userinput> +&prompt.root; <userinput>bsdlabel -Bw acd0</userinput> +&prompt.root; <userinput>newfs /dev/acd0</userinput></screen> - <para>您应根据实际情况将 <devicename>acd0</devicename> 改为您所使用的设备名。</para> + <para>您应根据实际情况将 <filename>acd0</filename> 改为您所使用的设备名。</para> </sect3> <sect3> @@ -1692,34 +1640,26 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>一旦您在 DVD-RAM 上完成了前面的操作, 就可以像普通的硬盘一样挂接它了:</para> - <screen>&prompt.root; <userinput>mount <replaceable>/dev/acd0</replaceable> <replaceable>/mnt</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>mount /dev/acd0 /mnt</userinput></screen> <para>然后就可以正常地对 DVD-RAM 进行读写了。</para> </sect3> </sect2> </sect1> - <sect1 id="floppies"> - <sect1info> + <sect1 xml:id="floppies"> + <info><title>创建和使用软盘</title> <authorgroup> - <author> - <firstname>Julio</firstname> - <surname>Merino</surname> - <contrib>原作 </contrib> - </author> + <author><personname><firstname>Julio</firstname><surname>Merino</surname></personname><contrib>原作 </contrib></author> </authorgroup> - <!-- 24 Dec 2001 --> + <authorgroup> - <author> - <firstname>Martin</firstname> - <surname>Karlsson</surname> - <contrib>重写 </contrib> - </author> + <author><personname><firstname>Martin</firstname><surname>Karlsson</surname></personname><contrib>重写 </contrib></author> </authorgroup> - <!-- 27 Apr 2003 --> - </sect1info> + + </info> - <title>创建和使用软盘</title> + <para>把数据存储在软盘上有时也是十分有用的。 例如, 在没有其它可靠的存储介质, @@ -1738,7 +1678,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>软盘的访问像其它设备一样是通过在 <filename>/dev</filename> 中的条目来实现的。 直接访问软盘时, 只需简单地使用 - <filename>/dev/fd<replaceable>N</replaceable></filename> 来表示。</para> + <filename>/dev/fdN</filename> 来表示。</para> </sect3> <sect3> @@ -1759,7 +1699,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <title>软盘的格式化</title> <para>使用 - <filename>/dev/fd<replaceable>N</replaceable></filename> + <filename>/dev/fdN</filename> 设备来格式化软盘。插入一张新的 3.5 英寸的软盘在你的设备中:</para> <screen>&prompt.root; <userinput>/usr/sbin/fdformat -f 1440 /dev/fd0</userinput></screen> @@ -1808,17 +1748,17 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>要使用软盘,需要先使用 &man.mount.msdosfs.8; 挂接它。 除此之外, 也可以使用在 ports 套件中的 - <filename role="package">emulators/mtools</filename> 程序。</para> + <package>emulators/mtools</package> 程序。</para> </sect2> </sect1> - <sect1 id="backups-tapebackups"> + <sect1 xml:id="backups-tapebackups"> <title>用磁带机备份</title> <indexterm><primary>tape media</primary></indexterm> <para>主流的磁带机有 4mm, 8mm, QIC, mini-cartridge 和 DLT。</para> - <sect2 id="backups-tapebackups-4mm"> + <sect2 xml:id="backups-tapebackups-4mm"> <title>4mm (DDS: Digital Data Storage)</title> <indexterm> @@ -1850,7 +1790,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>磁带在经过 2,000 次的使用或 100 次的全部备份后,就该退休了。</para> </sect2> - <sect2 id="backups-tapebackups-8mm"> + <sect2 xml:id="backups-tapebackups-8mm"> <title>8mm (Exabyte)</title> <indexterm> <primary>tape media</primary> @@ -1876,7 +1816,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c 从一端到另一端并可使磁道紧密地分布。</para> </sect2> - <sect2 id="backups-tapebackups-qic"> + <sect2 xml:id="backups-tapebackups-qic"> <title>QIC</title> <indexterm> <primary>tape media</primary> @@ -1906,7 +1846,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c <para>磁带机在经过 5,000 次的使用后,就该退休了。</para> </sect2> - <sect2 id="backups-tapebackups-dlt"> + <sect2 xml:id="backups-tapebackups-dlt"> <title>DLT</title> <indexterm> <primary>tape media</primary> @@ -1931,7 +1871,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c </sect2> <sect2> - <title id="backups-tapebackups-ait">AIT</title> + <title xml:id="backups-tapebackups-ait">AIT</title> <indexterm> <primary>tape media</primary> <secondary>AIT</secondary> @@ -1982,10 +1922,10 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> </sect2> </sect1> - <sect1 id="backups-floppybackups"> + <sect1 xml:id="backups-floppybackups"> <title>用软盘备份</title> - <sect2 id="floppies-using"> + <sect2 xml:id="floppies-using"> <title>能够使用软盘来备份数据吗</title> <indexterm><primary>backup floppies</primary></indexterm> <indexterm><primary>floppy disks</primary></indexterm> @@ -2012,13 +1952,13 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> 年了。最好使用一些名牌厂商的产品以确保质量。</para> </sect2> - <sect2 id="floppies-creating"> + <sect2 xml:id="floppies-creating"> <title>如何备份数据到软盘</title> <para>最好的备份数据到软盘的方法是使用 &man.tar.1; 程序加上 <option>-M</option> 选项, 它可以允许数据备份到多张软盘上。</para> - <para>要备份当前目录中所有的文件可以使用这个命令 (需要有 <username>root</username>权限):</para> + <para>要备份当前目录中所有的文件可以使用这个命令 (需要有 <systemitem class="username">root</systemitem>权限):</para> <screen>&prompt.root; <userinput>tar Mcvf /dev/fd0 *</userinput></screen> @@ -2029,7 +1969,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <para>这个步骤可能需要重复很多次,直到这些文件备份完成为止。</para> </sect2> - <sect2 id="floppies-compress"> + <sect2 xml:id="floppies-compress"> <title>可以压缩备份吗</title> <indexterm> <primary><command>tar</command></primary> @@ -2044,7 +1984,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> &man.gunzip.1; 解开。</para> </sect2> - <sect2 id="floppies-restoring"> + <sect2 xml:id="floppies-restoring"> <title>如何恢复备份</title> <para>要恢复所有文件:</para> @@ -2053,7 +1993,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <para>有两种方法来恢复软盘中的个别文件。首先,就要用第一张软盘启动:</para> - <screen>&prompt.root; <userinput>tar Mxvf /dev/fd0 <replaceable>filename</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>tar Mxvf /dev/fd0 filename</userinput></screen> <para>&man.tar.1; 程序会提示您插入后面的软盘,直到它找到所需要的文件。</para> @@ -2063,19 +2003,15 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> </sect2> </sect1> - <sect1 id="backup-strategies"> - <sect1info> + <sect1 xml:id="backup-strategies"> + <info><title>备份策略</title> <authorgroup> - <author> - <firstname>Lowell</firstname> - <surname>Gilbert</surname> - <contrib>原作 </contrib> - </author> + <author><personname><firstname>Lowell</firstname><surname>Gilbert</surname></personname><contrib>原作 </contrib></author> </authorgroup> - <!-- 3 Dec 2005 --> - </sect1info> + + </info> - <title>备份策略</title> + <para>设计备份计划的第一要务是确认以下问题皆已考虑到:</para> @@ -2143,7 +2079,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> 以及发生问题时应该如何处理。</para> </sect1> - <sect1 id="backup-basics"> + <sect1 xml:id="backup-basics"> <title>备份程序</title> <para>有三个主要的备份程序 &man.dump.8;、&man.tar.1; 和 &man.cpio.1;。</para> @@ -2186,7 +2122,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <command>rdump</command> 和 <command>rrestore</command> 的参数必须适用于远程主机 例如,当您从 FreeBSD 连到一台 SUN 工作站 knomodo 去使用磁带机时,使用:</para> - <screen>&prompt.root; <userinput>/sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nsa8 /dev/da0a 2>&1</userinput></screen> + <screen>&prompt.root; <userinput>/sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nsa8 /dev/da0a 2>&1</userinput></screen> <para>要注意的是:必须检查您在使用 <filename>.rhosts</filename> 时的安全情况。</para> @@ -2229,10 +2165,10 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <indexterm><primary><command>tar</command></primary></indexterm> <para>要 <command>tar</command> 到连接在名为 - <hostid>komodo</hostid> 的 Sun 机器上的 + <systemitem>komodo</systemitem> 的 Sun 机器上的 Exabyte 磁带机, 可以使用:</para> - <screen>&prompt.root; <userinput>tar cf - . | rsh komodo dd of=<replaceable>tape-device</replaceable> obs=20b</userinput></screen> + <screen>&prompt.root; <userinput>tar cf - . | rsh komodo dd of=tape-device obs=20b</userinput></screen> <para>如果您担心通过网络备份会有安全问题,应当使用 <command>ssh</command> , 而不是 <command>rsh</command>。</para> @@ -2254,10 +2190,10 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <para><command>cpio</command> 不支持通过网络的备份方式。可以使用 pipeline 和 <command>rsh</command> 来传送数据给远程的磁带机。</para> - <screen>&prompt.root; <userinput>for f in <replaceable>directory_list; do</replaceable></userinput> + <screen>&prompt.root; <userinput>for f in directory_list; do</userinput> <userinput>find $f >> backup.list</userinput> <userinput>done</userinput> -&prompt.root; <userinput>cpio -v -o --format=newc < backup.list | ssh <replaceable>user</replaceable>@<replaceable>host</replaceable> "cat > <replaceable>backup_device</replaceable>"</userinput></screen> +&prompt.root; <userinput>cpio -v -o --format=newc < backup.list | ssh user@host "cat > backup_device"</userinput></screen> <para>这里的 <replaceable>directory_list</replaceable> 是要备份的目录列表, <replaceable>user</replaceable>@<replaceable>host</replaceable> 结合了将 @@ -2283,7 +2219,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> 集比 <command>tar</command> 更接近 <command>cpio</command>。</para> </sect2> - <sect2 id="backups-programs-amanda"> + <sect2 xml:id="backups-programs-amanda"> <title><application>Amanda</application></title> <indexterm> <primary>backup software</primary> @@ -2338,9 +2274,8 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> 及恢复数据。这些怪异之处包括:具有 holes 和一个 nulls block 的文件, 文件名具有有趣字符,无法读写的文件及设备,在备份时改变文件大小,在 备份时建立或删除的文件。她将结果写在: LISA V in Oct. 1991. - 参阅 <ulink - url="http://www.coredumps.de/doc/dump/zwicky/testdump.doc.html ">torture-testing - Backup and Archive Programs</ulink>.</para> + 参阅 <link xlink:href="http://www.coredumps.de/doc/dump/zwicky/testdump.doc.html ">torture-testing + Backup and Archive Programs</link>.</para> </sect2> <sect2> @@ -2367,8 +2302,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> &man.restore.8;、 &man.fdisk.8;、 &man.bsdlabel.8;、 &man.newfs.8;、 &man.mount.8;, 等等。 Livefs CD 映像文件随 &os;/&arch.i386; &rel.current;-RELEASE 提供, - 可以从 <ulink - url="ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/&arch.i386;/ISO-IMAGES/&rel.current;/&os;-&rel.current;-RELEASE-&arch.i386;-livefs.iso"></ulink> + 可以从 <uri xlink:href="ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/&arch.i386;/ISO-IMAGES/&rel.current;/&os;-&rel.current;-RELEASE-&arch.i386;-livefs.iso">ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/&arch.i386;/ISO-IMAGES/&rel.current;/&os;-&rel.current;-RELEASE-&arch.i386;-livefs.iso</uri> 获得。</para> <para>第三,定期将数据备份到磁带。任何在上次备份后的改变都无法恢复。记得将 @@ -2404,7 +2338,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <guimenuitem>CDROM/DVD -- Use the live filesystem CDROM/DVD</guimenuitem> 这项。 您可以使用 <command>restore</command> 以及其他位于 - <filename class="directory">/mnt2/rescue</filename> 的工具。</para> + <filename>/mnt2/rescue</filename> 的工具。</para> <para>分别恢复每一个文件系统</para> <indexterm> @@ -2434,17 +2368,13 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> </sect2> </sect1> - <sect1 id="disks-virtual"> - <sect1info> + <sect1 xml:id="disks-virtual"> + <info><title>网络、内存和 和以及映像文件为介质的虚拟文件系统</title> <authorgroup> - <author> - <firstname>Marc</firstname> - <surname>Fonvieille</surname> - <contrib>Reorganized and enhanced by </contrib> - </author> + <author><personname><firstname>Marc</firstname><surname>Fonvieille</surname></personname><contrib>Reorganized and enhanced by </contrib></author> </authorgroup> - </sect1info> - <title>网络、内存和 和以及映像文件为介质的虚拟文件系统</title> + </info> + <indexterm><primary>virtual disks</primary></indexterm> <indexterm> <primary>磁盘</primary> @@ -2461,8 +2391,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <primary>disks</primary> <secondary>memory</secondary> </indexterm> - <para>这还包括, 如 <link - linkend="network-nfs">网络文件系统 (Network File System)</link> 和 Coda一类的网络文件系统、 + <para>这还包括, 如 <link linkend="network-nfs">网络文件系统 (Network File System)</link> 和 Coda一类的网络文件系统、 内存以及映像文件为介质的虚拟文件系统。</para> <para>随运行的 FreeBSD 版本不同, @@ -2472,7 +2401,7 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <para>系统会使用 &man.devfs.5; 来创建设备节点, 这对用户来说是透明的。</para> </note> - <sect2 id="disks-mdconfig"> + <sect2 xml:id="disks-mdconfig"> <title>以映像文件为介质的文件系统</title> <indexterm> <primary>disks (磁盘)</primary> @@ -2495,8 +2424,8 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <example> <title>使用 <command>mdconfig</command> 挂载已经存在的映像文件</title> - <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> + <screen>&prompt.root; <userinput>mdconfig -a -t vnode -f diskimage -u 0</userinput> +&prompt.root; <userinput>mount /dev/md0 /mnt</userinput></screen> </example> <para>使用 &man.mdconfig.8; 来创建新的映像文件:</para> @@ -2504,18 +2433,18 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen> <example> <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=newimage bs=1k count=5k</userinput> 5120+0 records in 5120+0 records out -&prompt.root; <userinput>mdconfig -a -t vnode -f <replaceable>newimage</replaceable> -u <replaceable>0</replaceable></userinput> -&prompt.root; <userinput>bsdlabel -w md<replaceable>0</replaceable> auto</userinput> -&prompt.root; <userinput>newfs md<replaceable>0</replaceable>a</userinput> +&prompt.root; <userinput>mdconfig -a -t vnode -f newimage -u 0</userinput> +&prompt.root; <userinput>bsdlabel -w md0 auto</userinput> +&prompt.root; <userinput>newfs md0a</userinput> /dev/md0a: 5.0MB (10224 sectors) block size 16384, fragment size 2048 using 4 cylinder groups of 1.25MB, 80 blks, 192 inodes. super-block backups (for fsck -b #) at: 160, 2720, 5280, 7840 -&prompt.root; <userinput>mount /dev/md<replaceable>0</replaceable>a <replaceable>/mnt</replaceable></userinput> -&prompt.root; <userinput>df <replaceable>/mnt</replaceable></userinput> +&prompt.root; <userinput>mount /dev/md0a /mnt</userinput> +&prompt.root; <userinput>df /mnt</userinput> Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md0a 4710 4 4330 0% /mnt</screen> </example> @@ -2524,7 +2453,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on &man.mdconfig.8; 将使用 &man.md.4; 为它自动选择一个未用的设备标识号。 分配给它的标识名将被输出到标准输出设备, 其形式是与 - <devicename>md4</devicename> 类似。 如果希望了解更多相关信息, 请参见联机手册 + <filename>md4</filename> 类似。 如果希望了解更多相关信息, 请参见联机手册 &man.mdconfig.8;。</para> <para>&man.mdconfig.8; 功能很强大, @@ -2537,11 +2466,11 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on <example> <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=newimage bs=1k count=5k</userinput> 5120+0 records in 5120+0 records out -&prompt.root; <userinput>mdmfs -F <replaceable>newimage</replaceable> -s <replaceable>5</replaceable>m md<replaceable>0</replaceable> <replaceable>/mnt</replaceable></userinput> -&prompt.root; <userinput>df <replaceable>/mnt</replaceable></userinput> +&prompt.root; <userinput>mdmfs -F newimage -s 5m md0 /mnt</userinput> +&prompt.root; <userinput>df /mnt</userinput> Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md0 4718 4 4338 0% /mnt</screen> </example> @@ -2553,7 +2482,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on </sect2> - <sect2 id="disks-md-freebsd5"> + <sect2 xml:id="disks-md-freebsd5"> <title>以内存为介质的文件系统</title> <indexterm> <primary>disks (磁盘)</primary> @@ -2572,23 +2501,23 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on <title>用 <command>mdconfig</command> 创建新的内存盘设备</title> - <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> + <screen>&prompt.root; <userinput>mdconfig -a -t swap -s 5m -u 1</userinput> +&prompt.root; <userinput>newfs -U md1</userinput> /dev/md1: 5.0MB (10240 sectors) block size 16384, fragment size 2048 using 4 cylinder groups of 1.27MB, 81 blks, 192 inodes. with soft updates super-block backups (for fsck -b #) at: 160, 2752, 5344, 7936 -&prompt.root; <userinput>mount /dev/md<replaceable>1</replaceable> <replaceable>/mnt</replaceable></userinput> -&prompt.root; <userinput>df <replaceable>/mnt</replaceable></userinput> +&prompt.root; <userinput>mount /dev/md1 /mnt</userinput> +&prompt.root; <userinput>df /mnt</userinput> Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md1 4718 4 4338 0% /mnt</screen> </example> <example> <title>使用 <command>mdmfs</command> 来新建内存介质文件系统</title> - <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> + <screen>&prompt.root; <userinput>mdmfs -s 5m md2 /mnt</userinput> +&prompt.root; <userinput>df /mnt</userinput> Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/md2 4846 2 4458 0% /mnt</screen> </example> @@ -2608,26 +2537,22 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on <para>例如, 要分离并释放所有 <filename>/dev/md4</filename> 使用的资源, 应使用命令:</para> - <screen>&prompt.root; <userinput>mdconfig -d -u <replaceable>4</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>mdconfig -d -u 4</userinput></screen> <para><command>mdconfig -l</command> 命令可以列出关于配置 &man.md.4; 设备的信息。</para> </sect2> </sect1> - <sect1 id="snapshots"> - <sect1info> + <sect1 xml:id="snapshots"> + <info><title>文件系统快照</title> <authorgroup> - <author> - <firstname>Tom</firstname> - <surname>Rhodes</surname> - <contrib>Contributed by </contrib> - </author> + <author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> - <!-- 15 JUL 2002 --> - </sect1info> + + </info> - <title>文件系统快照</title> + <indexterm> <primary>文件系统</primary> @@ -2705,10 +2630,10 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on <para>想了解更多关于 <option>softupdates</option> 和 文件系统快照的信息, 包括技术说明, 可以访问 Marshall Kirk McKusick 的 WWW 站点 - <ulink url="http://www.mckusick.com/"></ulink>。</para> + <uri xlink:href="http://www.mckusick.com/">http://www.mckusick.com/</uri>。</para> </sect1> - <sect1 id="quotas"> + <sect1 xml:id="quotas"> <title>文件系统配额</title> <indexterm> <primary>accounting</primary> @@ -2847,7 +2772,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on &man.edquota.8; 命令后面加上 <option>-p</option> 选项来完成。首先, 给用户分配所需要的配额限制,然后运行命令 <command>edquota -p protouser startuid-enduid</command>。例如,如果 - 用户 <username>test</username> 已经有了所需要的配额限制,下面的命令 + 用户 <systemitem class="username">test</systemitem> 已经有了所需要的配额限制,下面的命令 可以被用来复制那些 UIDs 为10,000 到 19,999 的配额限制:</para> <screen>&prompt.root; <userinput>edquota -p test 10000-19999</userinput></screen> @@ -2906,22 +2831,17 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on </sect1> - <sect1 id="disks-encrypting"> - <sect1info> + <sect1 xml:id="disks-encrypting"> + <info><title>加密磁盘分区</title> <authorgroup> - <author> - <firstname>Lucky</firstname> - <surname>Green</surname> - <contrib>Contributed by </contrib> - <affiliation> + <author><personname><firstname>Lucky</firstname><surname>Green</surname></personname><contrib>Contributed by </contrib><affiliation> <address><email>shamrock@cypherpunks.to</email></address> - </affiliation> - </author> + </affiliation></author> </authorgroup> - <!-- 11 MARCH 2003 --> - </sect1info> + + </info> - <title>加密磁盘分区</title> + <indexterm> <primary>disks</primary> <secondary>encrypting</secondary></indexterm> @@ -2945,7 +2865,7 @@ Filesystem 1K-blocks Used Avail Capacity Mounted on <procedure> <step> - <title>成为 <username>root</username></title> + <title>成为 <systemitem class="username">root</systemitem></title> <para>配置 <application>gbde</application> 需要超级用户的权力。</para> @@ -2961,8 +2881,7 @@ Password:</screen> <para><literal>options GEOM_BDE</literal></para> - <para>按照 <xref - linkend="kernelconfig"/> 所进行的介绍重新编译并安装内核。</para> + <para>按照 <xref linkend="kernelconfig"/> 所进行的介绍重新编译并安装内核。</para> <para>重新引导进入新的内核。</para> </step> @@ -2988,11 +2907,10 @@ Password:</screen> <step> <title>添加新的硬盘</title> - <para>添加新的硬盘到系统中可以查看在 <xref - linkend="disks-adding"/> 中的说明。 + <para>添加新的硬盘到系统中可以查看在 <xref linkend="disks-adding"/> 中的说明。 这个例子的目的是说明一个新的硬盘分区已经添加到系统中如: <filename>/dev/ad4s1c</filename>。在例子中 - <filename>/dev/ad0s1<replaceable>*</replaceable></filename> + <filename>/dev/ad0s1*</filename> 设备代表系统中存在的标准 FreeBSD 分区。</para> <screen>&prompt.root; <userinput>ls /dev/ad*</userinput> @@ -3043,9 +2961,8 @@ sector_size = 2048 保护您数据的能力依靠您选择输入的密钥的质量。 <footnote> <para>这个提示教您怎样选择一个安全易记的密钥短语, - 请看 <ulink - url="http://world.std.com/~reinhold/diceware.html">Diceware - Passphrase</ulink> 网站。</para></footnote></para> + 请看 <link xlink:href="http://world.std.com/~reinhold/diceware.html">Diceware + Passphrase</link> 网站。</para></footnote></para> <para><command>gbde init</command> 命令为您的 <application>gbde</application> 分区创建了一个 lock 文件, @@ -3097,7 +3014,7 @@ sector_size = 2048 <para>&man.newfs.8; 命令必须在一个 <application>gbde</application> 分区上执行, 这个分区通过一个存在的 - <filename><replaceable>*</replaceable>.bde</filename> + <filename>*.bde</filename> 设备名进行标识。</para> </note> </step> @@ -3138,7 +3055,7 @@ Filesystem Size Used Avail Capacity Mounted on <para>每次系统启动后, 在使用加密文件系统前必须和内核重新进行关联, 校验错误和再次挂接。使用的命令必须由 - <username>root</username>用户来执行。</para> + <systemitem class="username">root</systemitem>用户来执行。</para> <procedure> <step> @@ -3209,7 +3126,7 @@ gbde_lockdir="/etc/gbde"</programlisting> <para>&man.sysinstall.8; 是和 <application>gbde</application> 加密设备不兼容的。 在启动 &man.sysinstall.8; 时必须将 - <devicename><replaceable>*</replaceable>.bde</devicename> + <filename>*.bde</filename> 设备和内核进行分离,否则在初始化探测设备时将引起冲突。 与加密设备进行分离在我们的例子中使用如下的命令:</para> <screen>&prompt.root; <userinput>gbde detach /dev/ad4s1c</userinput></screen> @@ -3223,18 +3140,14 @@ gbde_lockdir="/etc/gbde"</programlisting> </sect2> <sect2> - <sect2info> + <info><title>使用 <command>geli</command> 对磁盘进行加密</title> <authorgroup> - <author> - <firstname>Daniel</firstname> - <surname>Gerzo</surname> - <contrib>撰写者 </contrib> - </author> + <author><personname><firstname>Daniel</firstname><surname>Gerzo</surname></personname><contrib>撰写者 </contrib></author> </authorgroup> - <!-- Date of writing: 28 November 2005 --> - </sect2info> + + </info> - <title>使用 <command>geli</command> 对磁盘进行加密</title> + <para>还有另一个可用于加密的 GEOM class — <command>geli</command>。 它目前由 @@ -3295,8 +3208,7 @@ gbde_lockdir="/etc/gbde"</programlisting> <programlisting>options GEOM_ELI device crypto</programlisting> - <para>按照 <xref - linkend="kernelconfig"/> 介绍的步骤重新编译并安装内核。</para> + <para>按照 <xref linkend="kernelconfig"/> 介绍的步骤重新编译并安装内核。</para> <para>另外, <command>geli</command> 也可以在系统引导时加载。 这是通过在 <filename>/boot/loader.conf</filename> 中增加下面的配置来实现的:</para> @@ -3311,7 +3223,7 @@ device crypto</programlisting> <para>下面的例子讲描述如何生成密钥文件, 它将作为主密钥 (Master Key) 的一部分, 用于挂接到 - <filename class="directory">/private</filename> 的加密 provider。 + <filename>/private</filename> 的加密 provider。 这个密钥文件将提供一些随机数据来加密主密钥。 同时, 主密钥也会使用一个口令字来保护。 Provider 的扇区尺寸为 4kB。 此外, 这里的讨论将介绍如何挂载 @@ -3346,7 +3258,7 @@ Reenter new passphrase:</screen> Enter passphrase:</screen> <para>新的明文设备将被命名为 - <filename>/dev/<replaceable>da2</replaceable>.eli</filename>。</para> + <filename>/dev/da2.eli</filename>。</para> <screen>&prompt.root; <userinput>ls /dev/da2*</userinput> /dev/da2 /dev/da2.eli</screen> @@ -3377,7 +3289,7 @@ Filesystem Size Used Avail Capacity Mounted on <title>卸下卷并断开 provider</title> <para>一旦在加密分区上的工作完成, - 并且不再需要 <filename class="directory">/private</filename> 分区, + 并且不再需要 <filename>/private</filename> 分区, 就应考虑将其卸下并将 <command>geli</command> 加密分区从内核上断开。</para> <screen>&prompt.root; <userinput>umount /private</userinput> @@ -3413,18 +3325,14 @@ geli_da2_flags="-p -k /root/da2.key"</programlisting> </sect1> - <sect1 id="swap-encrypting"> - <sect1info> + <sect1 xml:id="swap-encrypting"> + <info><title>对交换区进行加密</title> <authorgroup> - <author> - <firstname>Christian</firstname> - <surname>Brüffer</surname> - <contrib>原作 </contrib> - </author> + <author><personname><firstname>Christian</firstname><surname>Brüffer</surname></personname><contrib>原作 </contrib></author> </authorgroup> - </sect1info> + </info> - <title>对交换区进行加密</title> + <indexterm> <primary>swap (交换区)</primary> <secondary>encrypting (加密)</secondary> @@ -3455,7 +3363,7 @@ geli_da2_flags="-p -k /root/da2.key"</programlisting> <title>准备</title> <note> - <para>在本节余下的部分中, 我们约定使用 <devicename>ad0s1b</devicename> + <para>在本节余下的部分中, 我们约定使用 <filename>ad0s1b</filename> 作为交换区。</para> </note> @@ -3529,38 +3437,21 @@ Device 1K-blocks Used Avail Capacity </sect2> </sect1> - <sect1 id="disks-hast"> - <sect1info> + <sect1 xml:id="disks-hast"> + <info><title>高可用性存储 (HAST)</title> <authorgroup> - <author> - <firstname>Daniel</firstname> - <surname>Gerzo</surname> - <contrib>Contributed by </contrib> - </author> + <author><personname><firstname>Daniel</firstname><surname>Gerzo</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> <authorgroup> - <author> - <firstname>Freddie</firstname> - <surname>Cash</surname> - <contrib>With inputs from </contrib> - </author> - <author> - <firstname>Pawel Jakub</firstname> - <surname>Dawidek</surname> - </author> - <author> - <firstname>Michael W.</firstname> - <surname>Lucas</surname> - </author> - <author> - <firstname>Viktor</firstname> - <surname>Petersson</surname> - </author> + <author><personname><firstname>Freddie</firstname><surname>Cash</surname></personname><contrib>With inputs from </contrib></author> + <author><personname><firstname>Pawel Jakub</firstname><surname>Dawidek</surname></personname></author> + <author><personname><firstname>Michael W.</firstname><surname>Lucas</surname></personname></author> + <author><personname><firstname>Viktor</firstname><surname>Petersson</surname></personname></author> </authorgroup> - <!-- Date of writing: 26 February 2011 --> - </sect1info> + + </info> - <title>高可用性存储 (HAST)</title> + <indexterm> <primary>HAST</primary> <secondary>高可用性 (high availability)</secondary> @@ -3604,8 +3495,7 @@ Device 1K-blocks Used Avail Capacity (<xref linkend="basics"/>)。</para> </listitem> <listitem> - <para>知道如何配置网络接口以及其他核心 &os; 子系统 (<xref - linkend="config-tuning"/>)。</para> + <para>知道如何配置网络接口以及其他核心 &os; 子系统 (<xref linkend="config-tuning"/>)。</para> </listitem> <listitem> <para>理解 &os; 的网络功能 @@ -3617,9 +3507,8 @@ Device 1K-blocks Used Avail Capacity </itemizedlist> <para><acronym>HAST</acronym> 项目是由 - &os; 基金会资助完成的, 并得到了来自 <ulink - url="http://www.omc.net/">OMCnet Internet Service GmbH</ulink> - 和 <ulink url="http://www.transip.nl/">TransIP BV</ulink> + &os; 基金会资助完成的, 并得到了来自 <link xlink:href="http://www.omc.net/">OMCnet Internet Service GmbH</link> + 和 <link xlink:href="http://www.transip.nl/">TransIP BV</link> 的支持。</para> </sect2> @@ -3691,7 +3580,7 @@ Device 1K-blocks Used Avail Capacity <para><acronym>HAST</acronym> 在块的级别上同步运行, 这使其对文件系统和应用程序透明。 <acronym>HAST</acronym> - 在 <filename class="directory">/dev/hast/</filename> + 在 <filename>/dev/hast/</filename> 目录中提供标准的 GEOM 设备供其他工具或应用程序使用, 因此, 在使用上, 对应用程序或文件系统而言, <acronym>HAST</acronym> 提供的设备与普通的裸盘或分区等没有任何区别。</para> @@ -3775,17 +3664,16 @@ Device 1K-blocks Used Avail Capacity <para>下面的例子将介绍使用 <acronym>HAST</acronym> 在两个节点之间以 <literal>主</literal>-<literal>从</literal> 模式复制数据的方法。 两个节点的名字分别是 - <literal><replaceable>hasta</replaceable></literal> 其 IP, + <literal>hasta</literal> 其 IP, 地址为 <replaceable>172.16.0.1</replaceable>, 以及 - <literal><replaceable>hastb</replaceable></literal>, 其 IP + <literal>hastb</literal>, 其 IP 地址为 <replaceable>172.16.0.2</replaceable>。 这两台机器都使用尺寸相同的磁盘 - <devicename>/dev/<replaceable>ad6</replaceable></devicename> + <filename>/dev/ad6</filename> 来专用于 <acronym>HAST</acronym> 的运行。 <acronym>HAST</acronym> 存储池 (有时也称为资源, - 例如位于 <filename - class="directory">/dev/hast/</filename> 的设备文件) 将命名为 - <filename><replaceable>test</replaceable></filename>。</para> + 例如位于 <filename>/dev/hast/</filename> 的设备文件) 将命名为 + <filename>test</filename>。</para> <para><acronym>HAST</acronym> 的配置文件是 <filename>/etc/hast.conf</filename>。 在两个节点上, @@ -3834,21 +3722,20 @@ Device 1K-blocks Used Avail Capacity 节点的角色是由管理员手工, 或由类似 <application>Heartbeat</application> 这样的软件通过 &man.hastctl.8; 来完成配置的。 在希望成为主节点的系统 - (<literal><replaceable>hasta</replaceable></literal>) + (<literal>hasta</literal>) 上运行下面的命令令其成为主节点:</para> <screen>&prompt.root; <userinput>hastctl role primary test</userinput></screen> <para>类似地, 用下面的命令来指明从节点 - (<literal><replaceable>hastb</replaceable></literal>):</para> + (<literal>hastb</literal>):</para> <screen>&prompt.root; <userinput>hastctl role secondary test</userinput></screen> <caution> <para>有可能会出现两个节点之间无法正常通讯, 但又都配置为主节点这样的情况; 这种称作 - <literal>脑分裂</literal> 的状态是十分危险的。 在 <xref - linkend="disks-hast-sb"/> 中介绍了如何从这种状态中恢复的方法。</para> + <literal>脑分裂</literal> 的状态是十分危险的。 在 <xref linkend="disks-hast-sb"/> 中介绍了如何从这种状态中恢复的方法。</para> </caution> <para>接下来, 可以在两个节点上分别用 @@ -3866,10 +3753,10 @@ Device 1K-blocks Used Avail Capacity <para>最后一步是在 GEOM 设备 - <devicename>/dev/hast/<replaceable>test</replaceable></devicename> + <filename>/dev/hast/test</filename> 上创建文件系统。 这项工作必须在 <literal>主</literal> 节点上进行 (因为 - <filename>/dev/hast/<replaceable>test</replaceable></filename> + <filename>/dev/hast/test</filename> 只在 <literal>主</literal> 节点上出现), 随硬盘尺寸的不同, 这可能需要花费数分钟的时间:</para> @@ -3903,7 +3790,7 @@ Device 1K-blocks Used Avail Capacity 它允许多个同网段的主机共享同一 IP 地址。 请根据 <xref linkend="carp"/> 的介绍在两个节点上都配置 <acronym>CARP</acronym>。 完成这些配置之后, 两个节点都会有自己的 - <devicename>carp0</devicename> 网络接口, + <filename>carp0</filename> 网络接口, 共用 IP 地址 <replaceable>172.16.0.254</replaceable>。 显然, 集群中的 <acronym>HAST</acronym> 主节点也必须是 <acronym>CARP</acronym> 主节点。</para> @@ -3946,7 +3833,7 @@ notify 30 { <screen>&prompt.root; <userinput>/etc/rc.d/devd restart</userinput></screen> - <para>当网络接口 <devicename>carp0</devicename> + <para>当网络接口 <filename>carp0</filename> 的状态发生变化时, 系统会产生一个通知消息, 这允许 &man.devd.8; 子系统运行管理员指定的任意脚本, 在这个例子中是 @@ -3983,7 +3870,7 @@ case "$1" in # Wait for any "hastd secondary" processes to stop for disk in ${resources}; do - while $( pgrep -lf "hastd: ${disk} \(secondary\)" > /dev/null 2>&1 ); do + while $( pgrep -lf "hastd: ${disk} \(secondary\)" > /dev/null 2>&1 ); do sleep 1 done @@ -4031,7 +3918,7 @@ case "$1" in umount -f /hast/${disk} fi sleep $delay - hastctl role secondary ${disk} 2>&1 + hastctl role secondary ${disk} 2>&1 if [ $? -ne 0 ]; then logger -p $log -t $name "Unable to switch role to secondary for resource ${disk}." exit 1 @@ -4081,8 +3968,7 @@ esac</programlisting> 文件系统, 或者使用 ZFS 文件系统。</para> </tip> - <para>更具体的信息和例子请参阅 <ulink - url="http://wiki.FreeBSD.org/HAST">HAST Wiki</ulink> + <para>更具体的信息和例子请参阅 <link xlink:href="http://wiki.FreeBSD.org/HAST">HAST Wiki</link> 页面。</para> </sect3> </sect2> @@ -4107,7 +3993,7 @@ esac</programlisting> 参数来启动服务, 它会令 &man.hastd.8; 服务在前台运行。</para> </sect3> - <sect3 id="disks-hast-sb"> + <sect3 xml:id="disks-hast-sb"> <title>从脑分裂状态恢复</title> <para>当集群中的两个节点之间无法相互通讯时, |