<?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="space-mounting">
  <?dbhtml filename="mounting.html"?>

  <title>挂载新的分区</title>

  <!--para>Now that a file system has been created, the partition needs to
  be made accessible. In order to do this, the partition needs to be
  mounted at a chosen mount point. For the purposes of this book, it is
  assumed that the file system is mounted under the directory specified by the
  <envar>LFS</envar> environment variable as described in the previous section.
  </para-->
  <para>我们已经在分区上建立了文件系统，为了访问分区，
	  我们需要把分区挂载到选定的挂载点上。正如前一节所述，
	  本书假设将文件系统挂载到 <envar>LFS</envar> 环境变量指定的目录中。
  </para>

  <!--para>Create the mount point and mount the LFS file system by running:</para-->
  <para>输入以下命令以创建挂载点，并挂载 LFS 文件系统：</para>

<screen role="nodump"><userinput>mkdir -pv $LFS
mount -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable> $LFS</userinput></screen>

  <!--para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the designation of the LFS
  partition.</para-->
  <para>将 <replaceable>&lt;xxx&gt;</replaceable> 替换成 LFS 分区的代号。
  </para>

  <!--para>If using multiple partitions for LFS (e.g., one for <filename
  class="directory">/</filename> and another for <filename
  class="directory">/usr</filename>), mount them using:</para-->
  <para>如果为 LFS 创建了多个分区 (例如一个作为
	  <filename class="directory">/</filename>，另一个作为
	  <filename class="directory">/usr</filename>)，那么它们都需要被挂载：
  </para>

<screen role="nodump"><userinput>mkdir -pv $LFS
mount -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable> $LFS
mkdir -v $LFS/usr
mount -v -t ext4 /dev/<replaceable>&lt;yyy&gt;</replaceable> $LFS/usr</userinput></screen>

  <para>将 <replaceable>&lt;xxx&gt;</replaceable> 和
  <replaceable>&lt;yyy&gt;</replaceable> 替换成对应的分区代号。</para>

  <!--para>Ensure that this new partition is not mounted with permissions that are
  too restrictive (such as the <option>nosuid</option> or
  <option>nodev</option> options). Run the <command>mount</command> command
  without any parameters to see what options are set for the mounted LFS
  partition. If <option>nosuid</option> and/or <option>nodev</option> are set,
  the partition will need to be remounted.</para-->
  <para>请确认在挂载新分区时没有使用过于严格的安全限制 (比如
	  <option>nosuid</option> 或者 <option>nodev</option> 等选项) 。
	  直接执行不带任何参数的 <command>mount</command> 命令，
	  检查挂载好的 LFS 分区被指定了哪些选项。如果 <option>nodev</option>
	  或者 <option>nosuid</option> 被设置了，就必须重新挂载分区。</para>

  <warning><!--para>The above instructions assume that you will not be restarting
  your computer throughout the LFS process.  If you shut down your system,
  you will either need to remount the LFS partition each time you restart 
  the build process or modify your host system's /etc/fstab file to automatically 
  remount it upon boot.  For example:
  If you use additional optional partitions, be sure to add them also.

  </para-->
  <para>上面的命令假设您在构建 LFS 的过程中不会重启计算机。
	  如果您关闭了系统，那么您要么在继续构建过程时重新挂载分区，
	  要么修改宿主系统的 <filename>/etc/fstab</filename> 文件，
	  使得系统在引导时自动挂载它们。例如：

<screen role="nodump">/dev/<replaceable>&lt;xxx&gt;</replaceable>  /mnt/lfs ext4   defaults      1     1</screen>

	  如果您使用了多个分区，它们都需要添加到<filename>fstab</filename>中。
  </para>
  </warning>


  <!--para>If you are using a <systemitem
  class="filesystem">swap</systemitem> partition, ensure that it is enabled
  using the <command>swapon</command> command:</para-->
  <para>如果您使用了 <systemitem class="filesystem">swap</systemitem>
	  分区，使用 <command>swapon</command> 命令启用它：</para>

<screen role="nodump"><userinput>/sbin/swapon -v /dev/<replaceable>&lt;zzz&gt;</replaceable></userinput></screen>

  <!--para>Replace <replaceable>&lt;zzz&gt;</replaceable> with the name of the
  <systemitem class="filesystem">swap</systemitem> partition.</para-->
  <para>将 <replaceable>&lt;zzz&gt;</replaceable> 替换成
	  <systemitem class="filesystem">swap</systemitem> 分区的名称。</para>

  <!--para>Now that there is an established place to work, it is time to
  download the packages.</para-->
  <para>现在我们准备好了工作环境，可以下载软件包了。</para>

</sect1>

