Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

grub.xml chapter9

  • Loading branch information...
commit 740389a058cec0c76dca420e9b80ea06117104d5 1 parent d902348
authored March 14, 2012

Showing 1 changed file with 22 additions and 55 deletions. Show diff stats Hide diff stats

  1. 77  chapter08/grub.xml
77  chapter08/grub.xml
@@ -50,59 +50,38 @@ cat device.map</userinput></screen>
50 50
   <sect2>
51 51
     <title>创建配置</title>
52 52
 
53  
-    <para>GRUB works by writing data to the first physical track of the 
54  
-    hard disk.  This area is not part of any file system.  The programs
55  
-    there access GRUB modules in the boot partition.  The default location
56  
-    is /boot/grub/.</para>
57  
-
58  
-    <para>The location of the boot partition is a choice of the user that
59  
-    affects the configuration.  One recommendation is to have a separate small
60  
-    (suggested size is 100 MB) partition just for boot information.  That way
61  
-    each build, whether LFS or some commercial distro, can access the same boot
62  
-    files and access can be made from any booted system.  If you choose to do
63  
-    this, you will need to mount the separate partition, move all files in the
64  
-    current <filename class="directory">/boot</filename> directory (e.g. the
65  
-    linux kernel you just built in the previous section) to the new partition.
66  
-    You will then need to unmount the partition and remount it as <filename
67  
-    class="directory">/boot</filename>.  If you do this, be sure to update
68  
-    <filename>/etc/fstab</filename>.</para>
69  
-
70  
-    <para>Using the current lfs partition will also work, but configuration
71  
-    for multiple systems is more difficult.</para>
72  
-
73  
-    <para>Using the above information, determine the appropriate
74  
-    designator for the root partition (or boot partition, if a separate
75  
-    one is used). For the following example, it is assumed that the root
76  
-    (or separate boot) partition is <filename
77  
-    class="partition">sda2</filename>.</para>
78  
-
79  
-    <para>Install the GRUB files into <filename
80  
-    class="directory">/boot/grub</filename> and set up the boot track:</para> 
  53
+    <para>GRUB 的工作方式是将信息写入硬盘的开头区域。这个区域不属于任何一个文件系统。这个区域储存的程序会在启动时读取启动分区的GRUB模块。默认位置为 /boot/grub/。</para>
  54
+
  55
+    <para>启动分区的位置是用户的可选配置之一。一个建议是使用一个单独的小分区(建议100M)来作为启动分区。如果这样,你的机子上所有的系统(LFS 系统和一些发行版)都可以读取这个分区上相同的配置文件。如果你打算这么做,你需要挂载这个分区,然后将 <filename class="directory">/boot</filename> 文件夹 (包括你在前面章节编译的的内核)中的东西移动到这个被挂载了的分区。然后卸载这个分区,再重新将其挂载在 <filename
  56
+    class="directory">/boot</filename>,并确认你更新了 <filename>/etc/fstab</filename>。</para>
  57
+
  58
+    <para>使用当前的LFS分区一样没问题, 只是当你配置多系统启动的时候会有些麻烦。</para>
  59
+
  60
+    <para>根据上面的信息,决定你的根分区(或者启动分区,如果你选择使用一个单独的启动分区)的设计。下面的例子,假设根分区(或者单独的启动分区)是 <filename
  61
+    class="partition">sda2</filename>。</para>
  62
+
  63
+    <para>安装 GRUB 到<filename
  64
+    class="directory">/boot/grub</filename> 并设置引导:</para> 
81 65
 
82 66
     <warning>
83  
-      <para>The following command will overwrite the current boot loader. Do not
84  
-      run the command if this is not desired, for example, if using a third party
85  
-      boot manager to manage the Master Boot Record (MBR).</para> 
  67
+      <para>下面的命令会覆盖原先的boot loader。如果你不想如此, 不要这么做。例如,如果你使用一个第三方的启动管理器来管理MBR。</para> 
86 68
     </warning>
87 69
 
88 70
 <screen role="nodump"><userinput>grub-install /dev/sda</userinput></screen>
89 71
 
90  
-    <note><para><application>grub-install</application> is a script and calls another 
91  
-    program, grub-probe, that may fail with a message "cannot stat `/dev/root'".  
92  
-    If so, create a temporary symbolic link from your root partition to /dev/root:</para>
  72
+    <note><para><application>grub-install</application> 是一个脚本,它会调用 grub-probe。这个程序可能会失败,并提示 "cannot stat `/dev/root'"。如果这样,创建一个从你的根分区到 /dev/root 的临时符号链接:</para>
93 73
 
94 74
 <screen role="nodump"><userinput>ln -sv /dev/sda2 /dev/root</userinput></screen>
95 75
 
96  
-    <para>The symbolic link will only be present until the system is rebooted.
97  
-    The link is only needed for the installation procedure.
  76
+    <para>这个符号链接仅仅会存在于下次重启。它制作用于安装流程。
98 77
     </para></note>
99 78
 
100 79
   </sect2>
101 80
 
102 81
   <sect2>
103  
-    <title>Creating the Configuration File</title>
  82
+    <title>创建配置文件</title>
104 83
 
105  
-    <para>Generate <filename>/boot/grub/grub.cfg</filename>:</para>
  84
+    <para>创建 <filename>/boot/grub/grub.cfg</filename>:</para>
106 85
 
107 86
     <screen><userinput>cat &gt; /boot/grub/grub.cfg &lt;&lt; "EOF"
108 87
 <literal># Begin /boot/grub/grub.cfg
@@ -117,25 +96,13 @@ menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" {
117 96
 }</literal>
118 97
 EOF</userinput></screen>
119 98
 
120  
-    <note><para>From <application>GRUB</application>'s perspective, the
121  
-    kernel files are relative to the partition used.  If you
122  
-    used a separate /boot partition, remove /boot from the above
123  
-    <emphasis>linux</emphasis> line.  You will also need to change the
124  
-    <emphasis>set root</emphasis> line to point to the boot partition.
  99
+    <note><para>从 <application>GRUB</application> 的角度来看内核文件仅与其所在的分区相关。如果你使用一个单独的启动分区,从 <emphasis>linux</emphasis> 那行删掉/boot。你同时也需要将
  100
+    <emphasis>set root</emphasis> 改成你的根分区。
125 101
     </para></note> 
126 102
 
127  
-    <para>GRUB is an extremely powerful program and it provides a tremendous
128  
-    number of options for booting from a wide variety of devices, operating
129  
-    systems, and partition types.  There are also many options for customization 
130  
-    such as graphical splash screens, playing sounds, mouse input, etc.  The
131  
-    details of these options are beyond the scope of this introduction.</para>
132  
-
133  
-    <caution><para>There is a command, <application>grub-mkconfig</application>, that
134  
-    can write a configuration file automatically.  It uses a set of scripts in
135  
-    /etc/grub.d/ and will destroy any customizations that you make.  These scripts
136  
-    are designed primarily for non-source distributions and are not recommended for 
137  
-    LFS.  If you install a commercial Linux distribution, there is a good chance 
138  
-    that this program will be run.  Be sure to back up your grub.cfg file.</para></caution> 
  103
+    <para>GRUB是一个很棒的软件,它提供了大量的选项用于不同的设备,操作系统,分区。它也有一些个性化的设置如图形启动界面,启动声音,鼠标输入等等。这些话题超出了这篇介绍的范围。</para>
  104
+
  105
+    <caution><para><application>grub-mkconfig</application>这个命令可以自动生成一个配置文件。他会调用一系列 /etc/grub.d/ 中的脚本,并覆盖你原先的配置文件。这些脚本起初是为“非源码”发行版准备的,并不建议在LFS系统中使用它们。如果你使用一个商业Linux发行版,那么你有很大机会会用到他们。确保你备份了 grub.cfg 文件。</para></caution> 
139 106
 
140 107
    </sect2>
141 108
 

0 notes on commit 740389a

Please sign in to comment.
Something went wrong with that request. Please try again.