mounting.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="space-mounting">
  8. <?dbhtml filename="mounting.html"?>
  9. <title>挂载新的分区</title>
  10. <!--para>Now that a file system has been created, the partition needs to
  11. be made accessible. In order to do this, the partition needs to be
  12. mounted at a chosen mount point. For the purposes of this book, it is
  13. assumed that the file system is mounted under the directory specified by the
  14. <envar>LFS</envar> environment variable as described in the previous section.
  15. </para-->
  16. <para>我们已经在分区上建立了文件系统,为了访问分区,
  17. 我们需要把分区挂载到选定的挂载点上。正如前一节所述,
  18. 本书假设将文件系统挂载到 <envar>LFS</envar> 环境变量指定的目录中。
  19. </para>
  20. <!--para>Create the mount point and mount the LFS file system by running:</para-->
  21. <para>输入以下命令以创建挂载点,并挂载 LFS 文件系统:</para>
  22. <screen role="nodump"><userinput>mkdir -pv $LFS
  23. mount -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable> $LFS</userinput></screen>
  24. <!--para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the designation of the LFS
  25. partition.</para-->
  26. <para>将 <replaceable>&lt;xxx&gt;</replaceable> 替换成 LFS 分区的代号。
  27. </para>
  28. <!--para>If using multiple partitions for LFS (e.g., one for <filename
  29. class="directory">/</filename> and another for <filename
  30. class="directory">/usr</filename>), mount them using:</para-->
  31. <para>如果为 LFS 创建了多个分区 (例如一个作为
  32. <filename class="directory">/</filename>,另一个作为
  33. <filename class="directory">/usr</filename>),那么它们都需要被挂载:
  34. </para>
  35. <screen role="nodump"><userinput>mkdir -pv $LFS
  36. mount -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable> $LFS
  37. mkdir -v $LFS/usr
  38. mount -v -t ext4 /dev/<replaceable>&lt;yyy&gt;</replaceable> $LFS/usr</userinput></screen>
  39. <para>将 <replaceable>&lt;xxx&gt;</replaceable> 和
  40. <replaceable>&lt;yyy&gt;</replaceable> 替换成对应的分区代号。</para>
  41. <!--para>Ensure that this new partition is not mounted with permissions that are
  42. too restrictive (such as the <option>nosuid</option> or
  43. <option>nodev</option> options). Run the <command>mount</command> command
  44. without any parameters to see what options are set for the mounted LFS
  45. partition. If <option>nosuid</option> and/or <option>nodev</option> are set,
  46. the partition will need to be remounted.</para-->
  47. <para>请确认在挂载新分区时没有使用过于严格的安全限制 (比如
  48. <option>nosuid</option> 或者 <option>nodev</option> 等选项) 。
  49. 直接执行不带任何参数的 <command>mount</command> 命令,
  50. 检查挂载好的 LFS 分区被指定了哪些选项。如果 <option>nodev</option>
  51. 或者 <option>nosuid</option> 被设置了,就必须重新挂载分区。</para>
  52. <warning><!--para>The above instructions assume that you will not be restarting
  53. your computer throughout the LFS process. If you shut down your system,
  54. you will either need to remount the LFS partition each time you restart
  55. the build process or modify your host system's /etc/fstab file to automatically
  56. remount it upon boot. For example:
  57. If you use additional optional partitions, be sure to add them also.
  58. </para-->
  59. <para>上面的命令假设您在构建 LFS 的过程中不会重启计算机。
  60. 如果您关闭了系统,那么您要么在继续构建过程时重新挂载分区,
  61. 要么修改宿主系统的 <filename>/etc/fstab</filename> 文件,
  62. 使得系统在引导时自动挂载它们。例如:
  63. <screen role="nodump">/dev/<replaceable>&lt;xxx&gt;</replaceable> /mnt/lfs ext4 defaults 1 1</screen>
  64. 如果您使用了多个分区,它们都需要添加到<filename>fstab</filename>中。
  65. </para>
  66. </warning>
  67. <!--para>If you are using a <systemitem
  68. class="filesystem">swap</systemitem> partition, ensure that it is enabled
  69. using the <command>swapon</command> command:</para-->
  70. <para>如果您使用了 <systemitem class="filesystem">swap</systemitem>
  71. 分区,使用 <command>swapon</command> 命令启用它:</para>
  72. <screen role="nodump"><userinput>/sbin/swapon -v /dev/<replaceable>&lt;zzz&gt;</replaceable></userinput></screen>
  73. <!--para>Replace <replaceable>&lt;zzz&gt;</replaceable> with the name of the
  74. <systemitem class="filesystem">swap</systemitem> partition.</para-->
  75. <para>将 <replaceable>&lt;zzz&gt;</replaceable> 替换成
  76. <systemitem class="filesystem">swap</systemitem> 分区的名称。</para>
  77. <!--para>Now that there is an established place to work, it is time to
  78. download the packages.</para-->
  79. <para>现在我们准备好了工作环境,可以下载软件包了。</para>
  80. </sect1>