Gentoo Archives: gentoo-doc-cvs

From: "Sven Vermeulen (swift)" <swift@g.o>
To: gentoo-doc-cvs@l.g.o
Subject: [gentoo-doc-cvs] gentoo commit in xml/htdocs/doc/en/handbook: hb-install-x86+amd64-bootloader.xml
Date: Tue, 17 Dec 2013 11:55:43
Message-Id: 20131217115540.5AEDA2004B@flycatcher.gentoo.org
1 swift 13/12/17 11:55:40
2
3 Modified: hb-install-x86+amd64-bootloader.xml
4 Log:
5 Move GRUB2 as default, mark GRUB Legacy as optional. Shuffle the sections to ordering is more logical. No content change otherwise
6
7 Revision Changes Path
8 1.35 xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml?rev=1.35&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml?rev=1.35&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml?r1=1.34&r2=1.35
13
14 Index: hb-install-x86+amd64-bootloader.xml
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml,v
17 retrieving revision 1.34
18 retrieving revision 1.35
19 diff -u -r1.34 -r1.35
20 --- hb-install-x86+amd64-bootloader.xml 17 Dec 2013 11:04:50 -0000 1.34
21 +++ hb-install-x86+amd64-bootloader.xml 17 Dec 2013 11:55:40 -0000 1.35
22 @@ -4,11 +4,11 @@
23 <!-- The content of this document is licensed under the CC-BY-SA license -->
24 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
25
26 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml,v 1.34 2013/12/17 11:04:50 swift Exp $ -->
27 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml,v 1.35 2013/12/17 11:55:40 swift Exp $ -->
28
29 <sections>
30
31 -<version>18</version>
32 +<version>19</version>
33 <date>2013-12-17</date>
34
35 <section>
36 @@ -124,8 +124,237 @@
37 </body>
38 </subsection>
39 </section>
40 +<section id="grub2" test="contains('AMD64 x86', func:keyval('arch'))">
41 +<title>Default: Using GRUB2</title>
42 +<subsection>
43 +<title>Installing GRUB2</title>
44 +<body>
45 +
46 +<p>
47 +GRUB2 is provided through the <c>sys-boot/grub</c> package. To deploy GRUB2, use
48 +the <e>SLOT</e> notation to tell Portage to install GRUB2. SLOTs are a feature
49 +of Gentoo Linux where multiple versions of the same package can be deployed
50 +simultaneously on a system. In our case, this means that GRUB Legacy and GRUB2
51 +can be installed on a system (software-wise) at the same time.
52 +</p>
53 +
54 +<note>
55 +GRUB2 might still be marked as ~<keyval id="arch" />. If that is the case, you
56 +can either wait and use <uri link="#grub">GRUB Legacy</uri> or unmask the
57 +package. This is explained in <uri
58 +link="handbook-amd64.xml?part=3&amp;chap=3#doc_chap2">Mixing Stable with
59 +Testing</uri>. Once GRUB2 is stabilized, the SLOT operator also is no longer
60 +mandatory.
61 +</note>
62 +
63 +<pre caption="Installing GRUB2">
64 +# <i>emerge sys-boot/grub:2</i>
65 +</pre>
66 +
67 +<p>
68 +The GRUB2 software is now installed on the system, but not activated yet.
69 +</p>
70 +
71 +</body>
72 +</subsection>
73 +<subsection>
74 +<title>Configuring GRUB2</title>
75 +<body>
76 +
77 +<p>
78 +First, let us install the necessary GRUB2 files in <path>/boot/grub</path>.
79 +Assuming the first disk (the one where the system boots from) is
80 +<path>/dev/sda</path>, the following command will do this for us:
81 +</p>
82 +
83 +<pre caption="Installing the GRUB2 files in /boot/grub">
84 +# <i>grub2-install /dev/sda</i>
85 +</pre>
86 +
87 +<p>
88 +Next, we can generate the GRUB2 configuration based on the user configuration
89 +specified in the <path>/etc/default/grub</path> file and
90 +<path>/etc/grub.d</path> scripts. In most cases, no configuration is needed
91 +by users as GRUB2 will automatically detect which kernel to boot (the highest
92 +one available in <path>/boot</path>) and what the root file system is.
93 +</p>
94 +
95 +<p>
96 +To generate the final GRUB2 configuration, run the <c>grub2-mkconfig</c>
97 +command:
98 +</p>
99 +
100 +<pre caption="Generating GRUB2 configuration">
101 +# <i>grub2-mkconfig -o /boot/grub/grub.cfg</i>
102 +Generating grub.cfg ...
103 +Found linux image: /boot/<keyval id="kernel-name" />
104 +Found initrd image: /boot/<keyval id="genkernel-initrd" />
105 +done
106 +</pre>
107 +
108 +<p>
109 +The output of the command <e>must</e> mention that at least one Linux image is
110 +found, as those are needed to boot the system. If you use initramfs or used
111 +<c>genkernel</c> to build the kernel, the correct initrd image should be
112 +detected as well. If this is not the case, go to <path>/boot</path> and check
113 +the contents using the <c>ls</c> command. If the files are indeed missing, go
114 +back to the kernel configuration and installation instructions.
115 +</p>
116 +
117 +</body>
118 +</subsection>
119 +</section>
120 +<section id="lilo" test="contains('AMD64 x86', func:keyval('arch'))">
121 +<title>Alternative: Using LILO</title>
122 +<subsection>
123 +<title>Installing LILO</title>
124 +<body>
125 +
126 +<p>
127 +LILO, the LInuxLOader, is the tried and true workhorse of Linux
128 +bootloaders. However, it lacks some features that GRUB has (which is
129 +also the reason why GRUB is currently gaining popularity). The reason
130 +why LILO is still used is that, on some systems, GRUB doesn't work and
131 +LILO does. Of course, it is also used because some people know LILO and
132 +want to stick with it. Either way, Gentoo supports both, and apparently
133 +you have chosen to use LILO.
134 +</p>
135 +
136 +<p>
137 +Installing LILO is a breeze; just use <c>emerge</c>.
138 +</p>
139 +
140 +<pre caption="Installing LILO">
141 +# <i>emerge lilo</i>
142 +</pre>
143 +
144 +</body>
145 +</subsection>
146 +<subsection>
147 +<title>Configuring LILO</title>
148 +<body>
149 +
150 +<p>
151 +To configure LILO, you must create <path>/etc/lilo.conf</path>. Fire up
152 +your favorite editor (in this handbook we use <c>nano</c> for
153 +consistency) and create the file.
154 +</p>
155 +
156 +<pre caption="Creating /etc/lilo.conf">
157 +# <i>nano -w /etc/lilo.conf</i>
158 +</pre>
159 +
160 +<p>
161 +Some sections ago we have asked you to remember the kernel-image name
162 +you have created. In the next example <path>lilo.conf</path> we use the
163 +example partitioning scheme.
164 +</p>
165 +
166 +<p>
167 +Make sure you use <e>your</e> kernel image filename and, if appropriate,
168 +<e>your</e> initrd image filename.
169 +</p>
170 +
171 +<note>
172 +If your root filesystem is JFS, you <e>must</e> add a <c>append="ro"</c>
173 +line after each boot item since JFS needs to replay its log before it allows
174 +read-write mounting.
175 +</note>
176 +
177 +<pre caption="Example /etc/lilo.conf">
178 +boot=/dev/sda <comment># Install LILO in the MBR</comment>
179 +prompt <comment># Give the user the chance to select another section</comment>
180 +timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment>
181 +default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment>
182 +
183 +image=/boot/<keyval id="kernel-name"/>
184 + label=gentoo <comment># Name we give to this section</comment>
185 + read-only <comment># Start with a read-only root. Do not alter!</comment>
186 + root=/dev/sda3 <comment># Location of the root filesystem</comment>
187 +
188 +image=/boot/<keyval id="kernel-name"/>
189 + label=gentoo.rescue <comment># Name we give to this section</comment>
190 + read-only <comment># Start with a read-only root. Do not alter!</comment>
191 + root=/dev/sda3 <comment># Location of the root filesystem</comment>
192 + append="init=/bin/bb" <comment># Launch the Gentoo static rescue shell</comment>
193 +
194 +<comment># The next two lines are only if you dualboot with a Windows system.</comment>
195 +<comment># In this case, Windows is hosted on /dev/sda6.</comment>
196 +other=/dev/sda6
197 + label=windows
198 +</pre>
199 +
200 +<note>
201 +If you use a different partitioning scheme and/or kernel image, adjust
202 +accordingly.
203 +</note>
204 +
205 +<p>
206 +If, while building the Linux kernel, you opted to include an initramfs to boot
207 +from, then you will need to change the configuration by referring to this
208 +initramfs file and telling the initramfs where your real root device is at:
209 +</p>
210 +
211 +<pre caption="LILO snippet for initramfs-enabled kernel builds">
212 +image=/boot/<keyval id="kernel-name"/>
213 + label=gentoo
214 + read-only
215 + <i>append="real_root=/dev/sda3"</i>
216 + <i>initrd=/boot/<keyval id="genkernel-initrd" /></i>
217 +</pre>
218 +
219 +<p>
220 +If you need to pass any additional options to the kernel, add an
221 +<c>append</c> statement to the section. As an example, we add the
222 +<c>video</c> statement to enable framebuffer:
223 +</p>
224 +
225 +<pre caption="Using append to add kernel options">
226 +image=/boot/<keyval id="kernel-name"/>
227 + label=gentoo
228 + read-only
229 + root=/dev/sda3
230 + <i>append="video=uvesafb:mtrr,ywrap,1024x768-32@85"</i>
231 +</pre>
232 +
233 +<p>
234 +If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
235 +because the BIOS can't handle large harddrives you'll need to append
236 +<c>sda=stroke</c>. Replace sda with the device that requires this option.
237 +</p>
238 +
239 +<p>
240 +<c>genkernel</c> users should know that their kernels use the same boot options
241 +as is used for the Installation CD. For instance, if you have SCSI devices, you
242 +should add <c>doscsi</c> as kernel option.
243 +</p>
244 +
245 +<p>
246 +Now save the file and exit. To finish up, you have to run <c>/sbin/lilo</c> so
247 +LILO can apply the <path>/etc/lilo.conf</path> to your system (i.e. install
248 +itself on the disk). Keep in mind that you'll also have to run
249 +<c>/sbin/lilo</c> every time you install a new kernel or make any changes to
250 +the menu.
251 +</p>
252 +
253 +<pre caption="Finishing the LILO installation">
254 +# <i>/sbin/lilo</i>
255 +</pre>
256 +
257 +<p>
258 +If you have more questions regarding LILO, please consult its <uri
259 +link="http://en.wikipedia.org/wiki/LILO_(boot_loader)">wikipedia page</uri>.
260 +</p>
261 +
262 +<p>
263 +You can now continue with <uri link="#reboot">Rebooting the System</uri>.
264 +</p>
265 +
266 +</body>
267 +</subsection>
268 +</section>
269 <section id="grub" test="contains('AMD64 x86',func:keyval('arch'))">
270 -<title>Default: Using GRUB Legacy</title>
271 +<title>Optional: Using GRUB Legacy</title>
272 <subsection>
273 <title>What is Legacy?</title>
274 <body>
275 @@ -453,235 +682,7 @@
276 </body>
277 </subsection>
278 </section>
279 -<section id="lilo" test="contains('AMD64 x86', func:keyval('arch'))">
280 -<title>Alternative: Using LILO</title>
281 -<subsection>
282 -<title>Installing LILO</title>
283 -<body>
284 -
285 -<p>
286 -LILO, the LInuxLOader, is the tried and true workhorse of Linux
287 -bootloaders. However, it lacks some features that GRUB has (which is
288 -also the reason why GRUB is currently gaining popularity). The reason
289 -why LILO is still used is that, on some systems, GRUB doesn't work and
290 -LILO does. Of course, it is also used because some people know LILO and
291 -want to stick with it. Either way, Gentoo supports both, and apparently
292 -you have chosen to use LILO.
293 -</p>
294 -
295 -<p>
296 -Installing LILO is a breeze; just use <c>emerge</c>.
297 -</p>
298 -
299 -<pre caption="Installing LILO">
300 -# <i>emerge lilo</i>
301 -</pre>
302 -
303 -</body>
304 -</subsection>
305 -<subsection>
306 -<title>Configuring LILO</title>
307 -<body>
308 -
309 -<p>
310 -To configure LILO, you must create <path>/etc/lilo.conf</path>. Fire up
311 -your favorite editor (in this handbook we use <c>nano</c> for
312 -consistency) and create the file.
313 -</p>
314 -
315 -<pre caption="Creating /etc/lilo.conf">
316 -# <i>nano -w /etc/lilo.conf</i>
317 -</pre>
318 -
319 -<p>
320 -Some sections ago we have asked you to remember the kernel-image name
321 -you have created. In the next example <path>lilo.conf</path> we use the
322 -example partitioning scheme.
323 -</p>
324 -
325 -<p>
326 -Make sure you use <e>your</e> kernel image filename and, if appropriate,
327 -<e>your</e> initrd image filename.
328 -</p>
329 -
330 -<note>
331 -If your root filesystem is JFS, you <e>must</e> add a <c>append="ro"</c>
332 -line after each boot item since JFS needs to replay its log before it allows
333 -read-write mounting.
334 -</note>
335 -
336 -<pre caption="Example /etc/lilo.conf">
337 -boot=/dev/sda <comment># Install LILO in the MBR</comment>
338 -prompt <comment># Give the user the chance to select another section</comment>
339 -timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment>
340 -default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment>
341
342 -image=/boot/<keyval id="kernel-name"/>
343 - label=gentoo <comment># Name we give to this section</comment>
344 - read-only <comment># Start with a read-only root. Do not alter!</comment>
345 - root=/dev/sda3 <comment># Location of the root filesystem</comment>
346 -
347 -image=/boot/<keyval id="kernel-name"/>
348 - label=gentoo.rescue <comment># Name we give to this section</comment>
349 - read-only <comment># Start with a read-only root. Do not alter!</comment>
350 - root=/dev/sda3 <comment># Location of the root filesystem</comment>
351 - append="init=/bin/bb" <comment># Launch the Gentoo static rescue shell</comment>
352 -
353 -<comment># The next two lines are only if you dualboot with a Windows system.</comment>
354 -<comment># In this case, Windows is hosted on /dev/sda6.</comment>
355 -other=/dev/sda6
356 - label=windows
357 -</pre>
358 -
359 -<note>
360 -If you use a different partitioning scheme and/or kernel image, adjust
361 -accordingly.
362 -</note>
363 -
364 -<p>
365 -If, while building the Linux kernel, you opted to include an initramfs to boot
366 -from, then you will need to change the configuration by referring to this
367 -initramfs file and telling the initramfs where your real root device is at:
368 -</p>
369 -
370 -<pre caption="LILO snippet for initramfs-enabled kernel builds">
371 -image=/boot/<keyval id="kernel-name"/>
372 - label=gentoo
373 - read-only
374 - <i>append="real_root=/dev/sda3"</i>
375 - <i>initrd=/boot/<keyval id="genkernel-initrd" /></i>
376 -</pre>
377 -
378 -<p>
379 -If you need to pass any additional options to the kernel, add an
380 -<c>append</c> statement to the section. As an example, we add the
381 -<c>video</c> statement to enable framebuffer:
382 -</p>
383 -
384 -<pre caption="Using append to add kernel options">
385 -image=/boot/<keyval id="kernel-name"/>
386 - label=gentoo
387 - read-only
388 - root=/dev/sda3
389 - <i>append="video=uvesafb:mtrr,ywrap,1024x768-32@85"</i>
390 -</pre>
391 -
392 -<p>
393 -If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
394 -because the BIOS can't handle large harddrives you'll need to append
395 -<c>sda=stroke</c>. Replace sda with the device that requires this option.
396 -</p>
397 -
398 -<p>
399 -<c>genkernel</c> users should know that their kernels use the same boot options
400 -as is used for the Installation CD. For instance, if you have SCSI devices, you
401 -should add <c>doscsi</c> as kernel option.
402 -</p>
403 -
404 -<p>
405 -Now save the file and exit. To finish up, you have to run <c>/sbin/lilo</c> so
406 -LILO can apply the <path>/etc/lilo.conf</path> to your system (i.e. install
407 -itself on the disk). Keep in mind that you'll also have to run
408 -<c>/sbin/lilo</c> every time you install a new kernel or make any changes to
409 -the menu.
410 -</p>
411 -
412 -<pre caption="Finishing the LILO installation">
413 -# <i>/sbin/lilo</i>
414 -</pre>
415 -
416 -<p>
417 -If you have more questions regarding LILO, please consult its <uri
418 -link="http://en.wikipedia.org/wiki/LILO_(boot_loader)">wikipedia page</uri>.
419 -</p>
420 -
421 -<p>
422 -You can now continue with <uri link="#reboot">Rebooting the System</uri>.
423 -</p>
424 -
425 -</body>
426 -</subsection>
427 -</section>
428 -<section id="grub2" test="contains('AMD64 x86', func:keyval('arch'))">
429 -<title>Alternative: Using GRUB2</title>
430 -<subsection>
431 -<title>Installing GRUB2</title>
432 -<body>
433 -
434 -<p>
435 -GRUB2 is provided through the <c>sys-boot/grub</c> package. To deploy GRUB2, use
436 -the <e>SLOT</e> notation to tell Portage to install GRUB2. SLOTs are a feature
437 -of Gentoo Linux where multiple versions of the same package can be deployed
438 -simultaneously on a system. In our case, this means that GRUB Legacy and GRUB2
439 -can be installed on a system (software-wise) at the same time.
440 -</p>
441 -
442 -<note>
443 -GRUB2 might still be marked as ~<keyval id="arch" />. If that is the case, you
444 -can either wait and use <uri link="#grub">GRUB Legacy</uri> or unmask the
445 -package. This is explained in <uri
446 -link="handbook-amd64.xml?part=3&amp;chap=3#doc_chap2">Mixing Stable with
447 -Testing</uri>. Once GRUB2 is stabilized, the SLOT operator also is no longer
448 -mandatory.
449 -</note>
450 -
451 -<pre caption="Installing GRUB2">
452 -# <i>emerge sys-boot/grub:2</i>
453 -</pre>
454 -
455 -<p>
456 -The GRUB2 software is now installed on the system, but not activated yet.
457 -</p>
458 -
459 -</body>
460 -</subsection>
461 -<subsection>
462 -<title>Configuring GRUB2</title>
463 -<body>
464 -
465 -<p>
466 -First, let us install the necessary GRUB2 files in <path>/boot/grub</path>.
467 -Assuming the first disk (the one where the system boots from) is
468 -<path>/dev/sda</path>, the following command will do this for us:
469 -</p>
470 -
471 -<pre caption="Installing the GRUB2 files in /boot/grub">
472 -# <i>grub2-install /dev/sda</i>
473 -</pre>
474 -
475 -<p>
476 -Next, we can generate the GRUB2 configuration based on the user configuration
477 -specified in the <path>/etc/default/grub</path> file and
478 -<path>/etc/grub.d</path> scripts. In most cases, no configuration is needed
479 -by users as GRUB2 will automatically detect which kernel to boot (the highest
480 -one available in <path>/boot</path>) and what the root file system is.
481 -</p>
482 -
483 -<p>
484 -To generate the final GRUB2 configuration, run the <c>grub2-mkconfig</c>
485 -command:
486 -</p>
487 -
488 -<pre caption="Generating GRUB2 configuration">
489 -# <i>grub2-mkconfig -o /boot/grub/grub.cfg</i>
490 -Generating grub.cfg ...
491 -Found linux image: /boot/<keyval id="kernel-name" />
492 -Found initrd image: /boot/<keyval id="genkernel-initrd" />
493 -done
494 -</pre>
495 -
496 -<p>
497 -The output of the command <e>must</e> mention that at least one Linux image is
498 -found, as those are needed to boot the system. If you use initramfs or used
499 -<c>genkernel</c> to build the kernel, the correct initrd image should be
500 -detected as well. If this is not the case, go to <path>/boot</path> and check
501 -the contents using the <c>ls</c> command. If the files are indeed missing, go
502 -back to the kernel configuration and installation instructions.
503 -</p>
504 -
505 -</body>
506 -</subsection>
507 -</section>
508 <section id="elilo" test="func:keyval('arch')='IA64'">
509 <title>Default: Installing elilo</title>
510 <body>