/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.34 Revision 1.35
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $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 $ --> 7<!-- $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 $ -->
8 8
9<sections> 9<sections>
10 10
11<version>18</version> 11<version>19</version>
12<date>2013-12-17</date> 12<date>2013-12-17</date>
13 13
14<section> 14<section>
15<title>Making your Choice</title> 15<title>Making your Choice</title>
16<subsection> 16<subsection>
122</p> 122</p>
123 123
124</body> 124</body>
125</subsection> 125</subsection>
126</section> 126</section>
127<section id="grub2" test="contains('AMD64 x86', func:keyval('arch'))">
128<title>Default: Using GRUB2</title>
129<subsection>
130<title>Installing GRUB2</title>
131<body>
132
133<p>
134GRUB2 is provided through the <c>sys-boot/grub</c> package. To deploy GRUB2, use
135the <e>SLOT</e> notation to tell Portage to install GRUB2. SLOTs are a feature
136of Gentoo Linux where multiple versions of the same package can be deployed
137simultaneously on a system. In our case, this means that GRUB Legacy and GRUB2
138can be installed on a system (software-wise) at the same time.
139</p>
140
141<note>
142GRUB2 might still be marked as ~<keyval id="arch" />. If that is the case, you
143can either wait and use <uri link="#grub">GRUB Legacy</uri> or unmask the
144package. This is explained in <uri
145link="handbook-amd64.xml?part=3&amp;chap=3#doc_chap2">Mixing Stable with
146Testing</uri>. Once GRUB2 is stabilized, the SLOT operator also is no longer
147mandatory.
148</note>
149
150<pre caption="Installing GRUB2">
151# <i>emerge sys-boot/grub:2</i>
152</pre>
153
154<p>
155The GRUB2 software is now installed on the system, but not activated yet.
156</p>
157
158</body>
159</subsection>
160<subsection>
161<title>Configuring GRUB2</title>
162<body>
163
164<p>
165First, let us install the necessary GRUB2 files in <path>/boot/grub</path>.
166Assuming the first disk (the one where the system boots from) is
167<path>/dev/sda</path>, the following command will do this for us:
168</p>
169
170<pre caption="Installing the GRUB2 files in /boot/grub">
171# <i>grub2-install /dev/sda</i>
172</pre>
173
174<p>
175Next, we can generate the GRUB2 configuration based on the user configuration
176specified in the <path>/etc/default/grub</path> file and
177<path>/etc/grub.d</path> scripts. In most cases, no configuration is needed
178by users as GRUB2 will automatically detect which kernel to boot (the highest
179one available in <path>/boot</path>) and what the root file system is.
180</p>
181
182<p>
183To generate the final GRUB2 configuration, run the <c>grub2-mkconfig</c>
184command:
185</p>
186
187<pre caption="Generating GRUB2 configuration">
188# <i>grub2-mkconfig -o /boot/grub/grub.cfg</i>
189Generating grub.cfg ...
190Found linux image: /boot/<keyval id="kernel-name" />
191Found initrd image: /boot/<keyval id="genkernel-initrd" />
192done
193</pre>
194
195<p>
196The output of the command <e>must</e> mention that at least one Linux image is
197found, as those are needed to boot the system. If you use initramfs or used
198<c>genkernel</c> to build the kernel, the correct initrd image should be
199detected as well. If this is not the case, go to <path>/boot</path> and check
200the contents using the <c>ls</c> command. If the files are indeed missing, go
201back to the kernel configuration and installation instructions.
202</p>
203
204</body>
205</subsection>
206</section>
207<section id="lilo" test="contains('AMD64 x86', func:keyval('arch'))">
208<title>Alternative: Using LILO</title>
209<subsection>
210<title>Installing LILO</title>
211<body>
212
213<p>
214LILO, the LInuxLOader, is the tried and true workhorse of Linux
215bootloaders. However, it lacks some features that GRUB has (which is
216also the reason why GRUB is currently gaining popularity). The reason
217why LILO is still used is that, on some systems, GRUB doesn't work and
218LILO does. Of course, it is also used because some people know LILO and
219want to stick with it. Either way, Gentoo supports both, and apparently
220you have chosen to use LILO.
221</p>
222
223<p>
224Installing LILO is a breeze; just use <c>emerge</c>.
225</p>
226
227<pre caption="Installing LILO">
228# <i>emerge lilo</i>
229</pre>
230
231</body>
232</subsection>
233<subsection>
234<title>Configuring LILO</title>
235<body>
236
237<p>
238To configure LILO, you must create <path>/etc/lilo.conf</path>. Fire up
239your favorite editor (in this handbook we use <c>nano</c> for
240consistency) and create the file.
241</p>
242
243<pre caption="Creating /etc/lilo.conf">
244# <i>nano -w /etc/lilo.conf</i>
245</pre>
246
247<p>
248Some sections ago we have asked you to remember the kernel-image name
249you have created. In the next example <path>lilo.conf</path> we use the
250example partitioning scheme.
251</p>
252
253<p>
254Make sure you use <e>your</e> kernel image filename and, if appropriate,
255<e>your</e> initrd image filename.
256</p>
257
258<note>
259If your root filesystem is JFS, you <e>must</e> add a <c>append="ro"</c>
260line after each boot item since JFS needs to replay its log before it allows
261read-write mounting.
262</note>
263
264<pre caption="Example /etc/lilo.conf">
265boot=/dev/sda <comment># Install LILO in the MBR</comment>
266prompt <comment># Give the user the chance to select another section</comment>
267timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment>
268default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment>
269
270image=/boot/<keyval id="kernel-name"/>
271 label=gentoo <comment># Name we give to this section</comment>
272 read-only <comment># Start with a read-only root. Do not alter!</comment>
273 root=/dev/sda3 <comment># Location of the root filesystem</comment>
274
275image=/boot/<keyval id="kernel-name"/>
276 label=gentoo.rescue <comment># Name we give to this section</comment>
277 read-only <comment># Start with a read-only root. Do not alter!</comment>
278 root=/dev/sda3 <comment># Location of the root filesystem</comment>
279 append="init=/bin/bb" <comment># Launch the Gentoo static rescue shell</comment>
280
281<comment># The next two lines are only if you dualboot with a Windows system.</comment>
282<comment># In this case, Windows is hosted on /dev/sda6.</comment>
283other=/dev/sda6
284 label=windows
285</pre>
286
287<note>
288If you use a different partitioning scheme and/or kernel image, adjust
289accordingly.
290</note>
291
292<p>
293If, while building the Linux kernel, you opted to include an initramfs to boot
294from, then you will need to change the configuration by referring to this
295initramfs file and telling the initramfs where your real root device is at:
296</p>
297
298<pre caption="LILO snippet for initramfs-enabled kernel builds">
299image=/boot/<keyval id="kernel-name"/>
300 label=gentoo
301 read-only
302 <i>append="real_root=/dev/sda3"</i>
303 <i>initrd=/boot/<keyval id="genkernel-initrd" /></i>
304</pre>
305
306<p>
307If you need to pass any additional options to the kernel, add an
308<c>append</c> statement to the section. As an example, we add the
309<c>video</c> statement to enable framebuffer:
310</p>
311
312<pre caption="Using append to add kernel options">
313image=/boot/<keyval id="kernel-name"/>
314 label=gentoo
315 read-only
316 root=/dev/sda3
317 <i>append="video=uvesafb:mtrr,ywrap,1024x768-32@85"</i>
318</pre>
319
320<p>
321If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
322because the BIOS can't handle large harddrives you'll need to append
323<c>sda=stroke</c>. Replace sda with the device that requires this option.
324</p>
325
326<p>
327<c>genkernel</c> users should know that their kernels use the same boot options
328as is used for the Installation CD. For instance, if you have SCSI devices, you
329should add <c>doscsi</c> as kernel option.
330</p>
331
332<p>
333Now save the file and exit. To finish up, you have to run <c>/sbin/lilo</c> so
334LILO can apply the <path>/etc/lilo.conf</path> to your system (i.e. install
335itself on the disk). Keep in mind that you'll also have to run
336<c>/sbin/lilo</c> every time you install a new kernel or make any changes to
337the menu.
338</p>
339
340<pre caption="Finishing the LILO installation">
341# <i>/sbin/lilo</i>
342</pre>
343
344<p>
345If you have more questions regarding LILO, please consult its <uri
346link="http://en.wikipedia.org/wiki/LILO_(boot_loader)">wikipedia page</uri>.
347</p>
348
349<p>
350You can now continue with <uri link="#reboot">Rebooting the System</uri>.
351</p>
352
353</body>
354</subsection>
355</section>
127<section id="grub" test="contains('AMD64 x86',func:keyval('arch'))"> 356<section id="grub" test="contains('AMD64 x86',func:keyval('arch'))">
128<title>Default: Using GRUB Legacy</title> 357<title>Optional: Using GRUB Legacy</title>
129<subsection> 358<subsection>
130<title>What is Legacy?</title> 359<title>What is Legacy?</title>
131<body> 360<body>
132 361
133<p> 362<p>
451</p> 680</p>
452 681
453</body> 682</body>
454</subsection> 683</subsection>
455</section> 684</section>
456<section id="lilo" test="contains('AMD64 x86', func:keyval('arch'))">
457<title>Alternative: Using LILO</title>
458<subsection>
459<title>Installing LILO</title>
460<body>
461 685
462<p>
463LILO, the LInuxLOader, is the tried and true workhorse of Linux
464bootloaders. However, it lacks some features that GRUB has (which is
465also the reason why GRUB is currently gaining popularity). The reason
466why LILO is still used is that, on some systems, GRUB doesn't work and
467LILO does. Of course, it is also used because some people know LILO and
468want to stick with it. Either way, Gentoo supports both, and apparently
469you have chosen to use LILO.
470</p>
471
472<p>
473Installing LILO is a breeze; just use <c>emerge</c>.
474</p>
475
476<pre caption="Installing LILO">
477# <i>emerge lilo</i>
478</pre>
479
480</body>
481</subsection>
482<subsection>
483<title>Configuring LILO</title>
484<body>
485
486<p>
487To configure LILO, you must create <path>/etc/lilo.conf</path>. Fire up
488your favorite editor (in this handbook we use <c>nano</c> for
489consistency) and create the file.
490</p>
491
492<pre caption="Creating /etc/lilo.conf">
493# <i>nano -w /etc/lilo.conf</i>
494</pre>
495
496<p>
497Some sections ago we have asked you to remember the kernel-image name
498you have created. In the next example <path>lilo.conf</path> we use the
499example partitioning scheme.
500</p>
501
502<p>
503Make sure you use <e>your</e> kernel image filename and, if appropriate,
504<e>your</e> initrd image filename.
505</p>
506
507<note>
508If your root filesystem is JFS, you <e>must</e> add a <c>append="ro"</c>
509line after each boot item since JFS needs to replay its log before it allows
510read-write mounting.
511</note>
512
513<pre caption="Example /etc/lilo.conf">
514boot=/dev/sda <comment># Install LILO in the MBR</comment>
515prompt <comment># Give the user the chance to select another section</comment>
516timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment>
517default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment>
518
519image=/boot/<keyval id="kernel-name"/>
520 label=gentoo <comment># Name we give to this section</comment>
521 read-only <comment># Start with a read-only root. Do not alter!</comment>
522 root=/dev/sda3 <comment># Location of the root filesystem</comment>
523
524image=/boot/<keyval id="kernel-name"/>
525 label=gentoo.rescue <comment># Name we give to this section</comment>
526 read-only <comment># Start with a read-only root. Do not alter!</comment>
527 root=/dev/sda3 <comment># Location of the root filesystem</comment>
528 append="init=/bin/bb" <comment># Launch the Gentoo static rescue shell</comment>
529
530<comment># The next two lines are only if you dualboot with a Windows system.</comment>
531<comment># In this case, Windows is hosted on /dev/sda6.</comment>
532other=/dev/sda6
533 label=windows
534</pre>
535
536<note>
537If you use a different partitioning scheme and/or kernel image, adjust
538accordingly.
539</note>
540
541<p>
542If, while building the Linux kernel, you opted to include an initramfs to boot
543from, then you will need to change the configuration by referring to this
544initramfs file and telling the initramfs where your real root device is at:
545</p>
546
547<pre caption="LILO snippet for initramfs-enabled kernel builds">
548image=/boot/<keyval id="kernel-name"/>
549 label=gentoo
550 read-only
551 <i>append="real_root=/dev/sda3"</i>
552 <i>initrd=/boot/<keyval id="genkernel-initrd" /></i>
553</pre>
554
555<p>
556If you need to pass any additional options to the kernel, add an
557<c>append</c> statement to the section. As an example, we add the
558<c>video</c> statement to enable framebuffer:
559</p>
560
561<pre caption="Using append to add kernel options">
562image=/boot/<keyval id="kernel-name"/>
563 label=gentoo
564 read-only
565 root=/dev/sda3
566 <i>append="video=uvesafb:mtrr,ywrap,1024x768-32@85"</i>
567</pre>
568
569<p>
570If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
571because the BIOS can't handle large harddrives you'll need to append
572<c>sda=stroke</c>. Replace sda with the device that requires this option.
573</p>
574
575<p>
576<c>genkernel</c> users should know that their kernels use the same boot options
577as is used for the Installation CD. For instance, if you have SCSI devices, you
578should add <c>doscsi</c> as kernel option.
579</p>
580
581<p>
582Now save the file and exit. To finish up, you have to run <c>/sbin/lilo</c> so
583LILO can apply the <path>/etc/lilo.conf</path> to your system (i.e. install
584itself on the disk). Keep in mind that you'll also have to run
585<c>/sbin/lilo</c> every time you install a new kernel or make any changes to
586the menu.
587</p>
588
589<pre caption="Finishing the LILO installation">
590# <i>/sbin/lilo</i>
591</pre>
592
593<p>
594If you have more questions regarding LILO, please consult its <uri
595link="http://en.wikipedia.org/wiki/LILO_(boot_loader)">wikipedia page</uri>.
596</p>
597
598<p>
599You can now continue with <uri link="#reboot">Rebooting the System</uri>.
600</p>
601
602</body>
603</subsection>
604</section>
605<section id="grub2" test="contains('AMD64 x86', func:keyval('arch'))">
606<title>Alternative: Using GRUB2</title>
607<subsection>
608<title>Installing GRUB2</title>
609<body>
610
611<p>
612GRUB2 is provided through the <c>sys-boot/grub</c> package. To deploy GRUB2, use
613the <e>SLOT</e> notation to tell Portage to install GRUB2. SLOTs are a feature
614of Gentoo Linux where multiple versions of the same package can be deployed
615simultaneously on a system. In our case, this means that GRUB Legacy and GRUB2
616can be installed on a system (software-wise) at the same time.
617</p>
618
619<note>
620GRUB2 might still be marked as ~<keyval id="arch" />. If that is the case, you
621can either wait and use <uri link="#grub">GRUB Legacy</uri> or unmask the
622package. This is explained in <uri
623link="handbook-amd64.xml?part=3&amp;chap=3#doc_chap2">Mixing Stable with
624Testing</uri>. Once GRUB2 is stabilized, the SLOT operator also is no longer
625mandatory.
626</note>
627
628<pre caption="Installing GRUB2">
629# <i>emerge sys-boot/grub:2</i>
630</pre>
631
632<p>
633The GRUB2 software is now installed on the system, but not activated yet.
634</p>
635
636</body>
637</subsection>
638<subsection>
639<title>Configuring GRUB2</title>
640<body>
641
642<p>
643First, let us install the necessary GRUB2 files in <path>/boot/grub</path>.
644Assuming the first disk (the one where the system boots from) is
645<path>/dev/sda</path>, the following command will do this for us:
646</p>
647
648<pre caption="Installing the GRUB2 files in /boot/grub">
649# <i>grub2-install /dev/sda</i>
650</pre>
651
652<p>
653Next, we can generate the GRUB2 configuration based on the user configuration
654specified in the <path>/etc/default/grub</path> file and
655<path>/etc/grub.d</path> scripts. In most cases, no configuration is needed
656by users as GRUB2 will automatically detect which kernel to boot (the highest
657one available in <path>/boot</path>) and what the root file system is.
658</p>
659
660<p>
661To generate the final GRUB2 configuration, run the <c>grub2-mkconfig</c>
662command:
663</p>
664
665<pre caption="Generating GRUB2 configuration">
666# <i>grub2-mkconfig -o /boot/grub/grub.cfg</i>
667Generating grub.cfg ...
668Found linux image: /boot/<keyval id="kernel-name" />
669Found initrd image: /boot/<keyval id="genkernel-initrd" />
670done
671</pre>
672
673<p>
674The output of the command <e>must</e> mention that at least one Linux image is
675found, as those are needed to boot the system. If you use initramfs or used
676<c>genkernel</c> to build the kernel, the correct initrd image should be
677detected as well. If this is not the case, go to <path>/boot</path> and check
678the contents using the <c>ls</c> command. If the files are indeed missing, go
679back to the kernel configuration and installation instructions.
680</p>
681
682</body>
683</subsection>
684</section>
685<section id="elilo" test="func:keyval('arch')='IA64'"> 686<section id="elilo" test="func:keyval('arch')='IA64'">
686<title>Default: Installing elilo</title> 687<title>Default: Installing elilo</title>
687<body> 688<body>
688 689
689<p> 690<p>

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.20