/[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.10 Revision 1.11
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.10 2008/04/01 08:53:46 nightmorph Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml,v 1.11 2008/05/02 08:04:23 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>6.0</version> 11<version>6.1</version>
12<date>2008-04-01</date> 12<date>2008-05-02</date>
13 13
14<section> 14<section>
15<title>Making your Choice</title> 15<title>Making your Choice</title>
16<subsection> 16<subsection>
17<title>Introduction</title> 17<title>Introduction</title>
186<body> 186<body>
187 187
188<p> 188<p>
189The most critical part of understanding GRUB is getting comfortable with how 189The most critical part of understanding GRUB is getting comfortable with how
190GRUB refers to hard drives and partitions. Your Linux partition 190GRUB refers to hard drives and partitions. Your Linux partition
191<path>/dev/hda1</path> (for IDE drives) or <path>/dev/sda1</path> (for
192SATA/SCSI drives) will most likely be called <path>(hd0,0)</path> under GRUB. 191<path>/dev/sda1</path> will most likely be called <path>(hd0,0)</path> under
193Notice the parentheses around the <path>hd0,0</path> - they are required. 192GRUB. Notice the parentheses around the <path>hd0,0</path> - they are
193required.
194</p> 194</p>
195 195
196<p> 196<p>
197Hard drives count from zero rather than "a" and partitions start at zero 197Hard drives count from zero rather than "a" and partitions start at zero
198rather than one. Be aware too that with the hd devices, only hard drives are 198rather than one. Be aware too that with the hd devices, only hard drives are
202When you ask the BIOS to boot from a different hard disk (for instance your 202When you ask the BIOS to boot from a different hard disk (for instance your
203primary slave), <e>that</e> harddisk is seen as <path>hd0</path>. 203primary slave), <e>that</e> harddisk is seen as <path>hd0</path>.
204</p> 204</p>
205 205
206<p> 206<p>
207Assuming you have a hard drive on <path>/dev/hda</path>, a cdrom player on 207Assuming you have a hard drive on <path>/dev/sda</path> and two more on
208<path>/dev/hdb</path>, a burner on <path>/dev/hdc</path>, a second hard drive 208<path>/dev/sdb</path> and <path>/dev/sdc</path>, <path>/dev/sdb7</path> gets
209on <path>/dev/hdd</path> and no SCSI hard drive, <path>/dev/hdd7</path> gets
210translated to <path>(hd1,6)</path>. It might sound tricky and tricky it is 209translated to <path>(hd1,6)</path>. It might sound tricky and tricky it is
211indeed, but as we will see, GRUB offers a tab completion mechanism 210indeed, but as we will see, GRUB offers a tab completion mechanism that comes
212that comes handy for those of you having a lot of hard drives and 211handy for those of you having a lot of hard drives and partitions and who are a
213partitions and who are a little lost in the GRUB numbering scheme. 212little lost in the GRUB numbering scheme.
214</p> 213</p>
215 214
216<p> 215<p>
217Having gotten the feel for that, it is time to install GRUB. 216Having gotten the feel for that, it is time to install GRUB.
218</p> 217</p>
282splashimage=(hd0,0)/boot/grub/splash.xpm.gz 281splashimage=(hd0,0)/boot/grub/splash.xpm.gz
283 282
284title Gentoo Linux <keyval id="kernel-version"/> 283title Gentoo Linux <keyval id="kernel-version"/>
285<comment># Partition where the kernel image (or operating system) is located</comment> 284<comment># Partition where the kernel image (or operating system) is located</comment>
286root (hd0,0) 285root (hd0,0)
287kernel /boot/<keyval id="kernel-name"/> root=/dev/hda3 286kernel /boot/<keyval id="kernel-name"/> root=/dev/sda3
288 287
289title Gentoo Linux <keyval id="kernel-version"/> (rescue) 288title Gentoo Linux <keyval id="kernel-version"/> (rescue)
290<comment># Partition where the kernel image (or operating system) is located</comment> 289<comment># Partition where the kernel image (or operating system) is located</comment>
291root (hd0,0) 290root (hd0,0)
292kernel /boot/<keyval id="kernel-name"/> root=/dev/hda3 init=/bin/bb 291kernel /boot/<keyval id="kernel-name"/> root=/dev/sda3 init=/bin/bb
293 292
294<comment># The next four lines are only if you dualboot with a Windows system.</comment> 293<comment># The next four lines are only if you dualboot with a Windows system.</comment>
295<comment># In this case, Windows is hosted on /dev/hda6.</comment> 294<comment># In this case, Windows is hosted on /dev/sda6.</comment>
296title Windows XP 295title Windows XP
297rootnoverify (hd0,5) 296rootnoverify (hd0,5)
298makeactive 297makeactive
299chainloader +1 298chainloader +1
300</pre> 299</pre>
304timeout 30 303timeout 30
305splashimage=(hd0,0)/boot/grub/splash.xpm.gz 304splashimage=(hd0,0)/boot/grub/splash.xpm.gz
306 305
307title Gentoo Linux <keyval id="kernel-version"/> 306title Gentoo Linux <keyval id="kernel-version"/>
308root (hd0,0) 307root (hd0,0)
309kernel /boot/<keyval id="genkernel-name"/> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev 308kernel /boot/<keyval id="genkernel-name"/> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev
310initrd /boot/<keyval id="genkernel-initrd"/> 309initrd /boot/<keyval id="genkernel-initrd"/>
311 310
312<comment># Only in case you want to dual-boot</comment> 311<comment># Only in case you want to dual-boot</comment>
313title Windows XP 312title Windows XP
314rootnoverify (hd0,5) 313rootnoverify (hd0,5)
341</p> 340</p>
342 341
343<p> 342<p>
344If you need to pass any additional options to the kernel, simply add 343If you need to pass any additional options to the kernel, simply add
345them to the end of the kernel command. We're already passing one option 344them to the end of the kernel command. We're already passing one option
346(<c>root=/dev/hda3</c> or <c>real_root=/dev/hda3</c>), but you can pass others 345(<c>root=/dev/sda3</c> or <c>real_root=/dev/sda3</c>), but you can pass others
347as well, such as the <c>video</c> and/or <c>vga</c> statements for framebuffer 346as well, such as the <c>video</c> and/or <c>vga</c> statements for framebuffer
348as we discussed previously. 347as we discussed previously.
349</p> 348</p>
350 349
351<p> 350<p>
352If you're using a 2.6.7 or higher kernel and you jumpered your harddrive 351If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
353because the BIOS can't handle large harddrives you'll need to append 352because the BIOS can't handle large harddrives you'll need to append
354<c>hdx=stroke</c>. 353<c>sda=stroke</c>. Replace sda with the device that requires this option.
355</p> 354</p>
356 355
357<p> 356<p>
358<c>genkernel</c> users should know that their kernels use the same boot options 357<c>genkernel</c> users should know that their kernels use the same boot options
359as is used for the Installation CD. For instance, if you have SCSI devices, you 358as is used for the Installation CD. For instance, if you have SCSI devices, you
401<p> 400<p>
402Now we can install GRUB using <c>grub-install</c>: 401Now we can install GRUB using <c>grub-install</c>:
403</p> 402</p>
404 403
405<pre caption="Running grub-install"> 404<pre caption="Running grub-install">
406# <i>grub-install --no-floppy /dev/hda</i> 405# <i>grub-install --no-floppy /dev/sda</i>
407</pre> 406</pre>
408 407
409<p> 408<p>
410If you have more questions regarding GRUB, please consult the <uri 409If you have more questions regarding GRUB, please consult the <uri
411link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri> or the 410link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri> or the
468 467
469<note> 468<note>
470If you want to install GRUB in a certain partition instead of the MBR, 469If you want to install GRUB in a certain partition instead of the MBR,
471you have to alter the <c>setup</c> command so it points to the right 470you have to alter the <c>setup</c> command so it points to the right
472partition. For instance, if you want GRUB installed in 471partition. For instance, if you want GRUB installed in
473<path>/dev/hda3</path>, then the command becomes <c>setup (hd0,2)</c>. 472<path>/dev/sda3</path>, then the command becomes <c>setup (hd0,2)</c>.
474Few users however want to do this. 473Few users however want to do this.
475</note> 474</note>
476 475
477<p> 476<p>
478If you have more questions regarding GRUB, please consult the <uri 477If you have more questions regarding GRUB, please consult the <uri
556line after each boot item since JFS needs to replay its log before it allows 555line after each boot item since JFS needs to replay its log before it allows
557read-write mounting. 556read-write mounting.
558</note> 557</note>
559 558
560<pre caption="Example /etc/lilo.conf"> 559<pre caption="Example /etc/lilo.conf">
561boot=/dev/hda <comment># Install LILO in the MBR</comment> 560boot=/dev/sda <comment># Install LILO in the MBR</comment>
562prompt <comment># Give the user the chance to select another section</comment> 561prompt <comment># Give the user the chance to select another section</comment>
563timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment> 562timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment>
564default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment> 563default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment>
565 564
566<comment># For non-genkernel users</comment> 565<comment># For non-genkernel users</comment>
567image=/boot/<keyval id="kernel-name"/> 566image=/boot/<keyval id="kernel-name"/>
568 label=gentoo <comment># Name we give to this section</comment> 567 label=gentoo <comment># Name we give to this section</comment>
569 read-only <comment># Start with a read-only root. Do not alter!</comment> 568 read-only <comment># Start with a read-only root. Do not alter!</comment>
570 root=/dev/hda3 <comment># Location of the root filesystem</comment> 569 root=/dev/sda3 <comment># Location of the root filesystem</comment>
571 570
572image=/boot/<keyval id="kernel-name"/> 571image=/boot/<keyval id="kernel-name"/>
573 label=gentoo.rescue <comment># Name we give to this section</comment> 572 label=gentoo.rescue <comment># Name we give to this section</comment>
574 read-only <comment># Start with a read-only root. Do not alter!</comment> 573 read-only <comment># Start with a read-only root. Do not alter!</comment>
575 root=/dev/hda3 <comment># Location of the root filesystem</comment> 574 root=/dev/sda3 <comment># Location of the root filesystem</comment>
576 append="init=/bin/bb" <comment># Launch the Gentoo static rescue shell</comment> 575 append="init=/bin/bb" <comment># Launch the Gentoo static rescue shell</comment>
577 576
578<comment># For genkernel users</comment> 577<comment># For genkernel users</comment>
579image=/boot/<keyval id="genkernel-name"/> 578image=/boot/<keyval id="genkernel-name"/>
580 label=gentoo 579 label=gentoo
581 read-only 580 read-only
582 root=/dev/ram0 581 root=/dev/ram0
583 append="init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev" 582 append="init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev"
584 initrd=/boot/<keyval id="genkernel-initrd"/> 583 initrd=/boot/<keyval id="genkernel-initrd"/>
585 584
586<comment># The next two lines are only if you dualboot with a Windows system.</comment> 585<comment># The next two lines are only if you dualboot with a Windows system.</comment>
587<comment># In this case, Windows is hosted on /dev/hda6.</comment> 586<comment># In this case, Windows is hosted on /dev/sda6.</comment>
588other=/dev/hda6 587other=/dev/sda6
589 label=windows 588 label=windows
590</pre> 589</pre>
591 590
592<note> 591<note>
593The <c>udev</c> mentioned at the end of the append line is needed to work around 592The <c>udev</c> mentioned at the end of the append line is needed to work around
608 607
609<pre caption="Using append to add kernel options"> 608<pre caption="Using append to add kernel options">
610image=/boot/<keyval id="kernel-name"/> 609image=/boot/<keyval id="kernel-name"/>
611 label=gentoo 610 label=gentoo
612 read-only 611 read-only
613 root=/dev/hda3 612 root=/dev/sda3
614 <i>append="video=vesafb:mtrr,ywrap,1024x768-32@85"</i> 613 <i>append="video=vesafb:mtrr,ywrap,1024x768-32@85"</i>
615</pre> 614</pre>
616 615
617<p> 616<p>
618If you're using a 2.6.7 or higher kernel and you jumpered your harddrive 617If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
619because the BIOS can't handle large harddrives you'll need to append 618because the BIOS can't handle large harddrives you'll need to append
620<c>hdx=stroke</c>. 619<c>sda=stroke</c>. Replace sda with the device that requires this option.
621</p> 620</p>
622 621
623<p> 622<p>
624<c>genkernel</c> users should know that their kernels use the same boot options 623<c>genkernel</c> users should know that their kernels use the same boot options
625as is used for the Installation CD. For instance, if you have SCSI devices, you 624as is used for the Installation CD. For instance, if you have SCSI devices, you

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20