| … | |
… | |
| 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> |
| 189 | The most critical part of understanding GRUB is getting comfortable with how |
189 | The most critical part of understanding GRUB is getting comfortable with how |
| 190 | GRUB refers to hard drives and partitions. Your Linux partition |
190 | GRUB refers to hard drives and partitions. Your Linux partition |
| 191 | <path>/dev/hda1</path> (for IDE drives) or <path>/dev/sda1</path> (for |
|
|
| 192 | SATA/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 |
| 193 | Notice the parentheses around the <path>hd0,0</path> - they are required. |
192 | GRUB. Notice the parentheses around the <path>hd0,0</path> - they are |
|
|
193 | required. |
| 194 | </p> |
194 | </p> |
| 195 | |
195 | |
| 196 | <p> |
196 | <p> |
| 197 | Hard drives count from zero rather than "a" and partitions start at zero |
197 | Hard drives count from zero rather than "a" and partitions start at zero |
| 198 | rather than one. Be aware too that with the hd devices, only hard drives are |
198 | rather than one. Be aware too that with the hd devices, only hard drives are |
| … | |
… | |
| 202 | When you ask the BIOS to boot from a different hard disk (for instance your |
202 | When you ask the BIOS to boot from a different hard disk (for instance your |
| 203 | primary slave), <e>that</e> harddisk is seen as <path>hd0</path>. |
203 | primary slave), <e>that</e> harddisk is seen as <path>hd0</path>. |
| 204 | </p> |
204 | </p> |
| 205 | |
205 | |
| 206 | <p> |
206 | <p> |
| 207 | Assuming you have a hard drive on <path>/dev/hda</path>, a cdrom player on |
207 | Assuming 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 |
| 209 | on <path>/dev/hdd</path> and no SCSI hard drive, <path>/dev/hdd7</path> gets |
|
|
| 210 | translated to <path>(hd1,6)</path>. It might sound tricky and tricky it is |
209 | translated to <path>(hd1,6)</path>. It might sound tricky and tricky it is |
| 211 | indeed, but as we will see, GRUB offers a tab completion mechanism |
210 | indeed, but as we will see, GRUB offers a tab completion mechanism that comes |
| 212 | that comes handy for those of you having a lot of hard drives and |
211 | handy for those of you having a lot of hard drives and partitions and who are a |
| 213 | partitions and who are a little lost in the GRUB numbering scheme. |
212 | little lost in the GRUB numbering scheme. |
| 214 | </p> |
213 | </p> |
| 215 | |
214 | |
| 216 | <p> |
215 | <p> |
| 217 | Having gotten the feel for that, it is time to install GRUB. |
216 | Having gotten the feel for that, it is time to install GRUB. |
| 218 | </p> |
217 | </p> |
| … | |
… | |
| 282 | splashimage=(hd0,0)/boot/grub/splash.xpm.gz |
281 | splashimage=(hd0,0)/boot/grub/splash.xpm.gz |
| 283 | |
282 | |
| 284 | title Gentoo Linux <keyval id="kernel-version"/> |
283 | title 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> |
| 286 | root (hd0,0) |
285 | root (hd0,0) |
| 287 | kernel /boot/<keyval id="kernel-name"/> root=/dev/hda3 |
286 | kernel /boot/<keyval id="kernel-name"/> root=/dev/sda3 |
| 288 | |
287 | |
| 289 | title Gentoo Linux <keyval id="kernel-version"/> (rescue) |
288 | title 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> |
| 291 | root (hd0,0) |
290 | root (hd0,0) |
| 292 | kernel /boot/<keyval id="kernel-name"/> root=/dev/hda3 init=/bin/bb |
291 | kernel /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> |
| 296 | title Windows XP |
295 | title Windows XP |
| 297 | rootnoverify (hd0,5) |
296 | rootnoverify (hd0,5) |
| 298 | makeactive |
297 | makeactive |
| 299 | chainloader +1 |
298 | chainloader +1 |
| 300 | </pre> |
299 | </pre> |
| … | |
… | |
| 304 | timeout 30 |
303 | timeout 30 |
| 305 | splashimage=(hd0,0)/boot/grub/splash.xpm.gz |
304 | splashimage=(hd0,0)/boot/grub/splash.xpm.gz |
| 306 | |
305 | |
| 307 | title Gentoo Linux <keyval id="kernel-version"/> |
306 | title Gentoo Linux <keyval id="kernel-version"/> |
| 308 | root (hd0,0) |
307 | root (hd0,0) |
| 309 | kernel /boot/<keyval id="genkernel-name"/> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev |
308 | kernel /boot/<keyval id="genkernel-name"/> root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev |
| 310 | initrd /boot/<keyval id="genkernel-initrd"/> |
309 | initrd /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> |
| 313 | title Windows XP |
312 | title Windows XP |
| 314 | rootnoverify (hd0,5) |
313 | rootnoverify (hd0,5) |
| … | |
… | |
| 341 | </p> |
340 | </p> |
| 342 | |
341 | |
| 343 | <p> |
342 | <p> |
| 344 | If you need to pass any additional options to the kernel, simply add |
343 | If you need to pass any additional options to the kernel, simply add |
| 345 | them to the end of the kernel command. We're already passing one option |
344 | them 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 |
| 347 | as well, such as the <c>video</c> and/or <c>vga</c> statements for framebuffer |
346 | as well, such as the <c>video</c> and/or <c>vga</c> statements for framebuffer |
| 348 | as we discussed previously. |
347 | as we discussed previously. |
| 349 | </p> |
348 | </p> |
| 350 | |
349 | |
| 351 | <p> |
350 | <p> |
| 352 | If you're using a 2.6.7 or higher kernel and you jumpered your harddrive |
351 | If you're using a 2.6.7 or higher kernel and you jumpered your harddrive |
| 353 | because the BIOS can't handle large harddrives you'll need to append |
352 | because 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 |
| 359 | as is used for the Installation CD. For instance, if you have SCSI devices, you |
358 | as is used for the Installation CD. For instance, if you have SCSI devices, you |
| … | |
… | |
| 401 | <p> |
400 | <p> |
| 402 | Now we can install GRUB using <c>grub-install</c>: |
401 | Now 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> |
| 410 | If you have more questions regarding GRUB, please consult the <uri |
409 | If you have more questions regarding GRUB, please consult the <uri |
| 411 | link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri> or the |
410 | link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri> or the |
| … | |
… | |
| 468 | |
467 | |
| 469 | <note> |
468 | <note> |
| 470 | If you want to install GRUB in a certain partition instead of the MBR, |
469 | If you want to install GRUB in a certain partition instead of the MBR, |
| 471 | you have to alter the <c>setup</c> command so it points to the right |
470 | you have to alter the <c>setup</c> command so it points to the right |
| 472 | partition. For instance, if you want GRUB installed in |
471 | partition. 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>. |
| 474 | Few users however want to do this. |
473 | Few users however want to do this. |
| 475 | </note> |
474 | </note> |
| 476 | |
475 | |
| 477 | <p> |
476 | <p> |
| 478 | If you have more questions regarding GRUB, please consult the <uri |
477 | If you have more questions regarding GRUB, please consult the <uri |
| … | |
… | |
| 556 | line after each boot item since JFS needs to replay its log before it allows |
555 | line after each boot item since JFS needs to replay its log before it allows |
| 557 | read-write mounting. |
556 | read-write mounting. |
| 558 | </note> |
557 | </note> |
| 559 | |
558 | |
| 560 | <pre caption="Example /etc/lilo.conf"> |
559 | <pre caption="Example /etc/lilo.conf"> |
| 561 | boot=/dev/hda <comment># Install LILO in the MBR</comment> |
560 | boot=/dev/sda <comment># Install LILO in the MBR</comment> |
| 562 | prompt <comment># Give the user the chance to select another section</comment> |
561 | prompt <comment># Give the user the chance to select another section</comment> |
| 563 | timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment> |
562 | timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment> |
| 564 | default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment> |
563 | default=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> |
| 567 | image=/boot/<keyval id="kernel-name"/> |
566 | image=/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 | |
| 572 | image=/boot/<keyval id="kernel-name"/> |
571 | image=/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> |
| 579 | image=/boot/<keyval id="genkernel-name"/> |
578 | image=/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> |
| 588 | other=/dev/hda6 |
587 | other=/dev/sda6 |
| 589 | label=windows |
588 | label=windows |
| 590 | </pre> |
589 | </pre> |
| 591 | |
590 | |
| 592 | <note> |
591 | <note> |
| 593 | The <c>udev</c> mentioned at the end of the append line is needed to work around |
592 | The <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"> |
| 610 | image=/boot/<keyval id="kernel-name"/> |
609 | image=/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> |
| 618 | If you're using a 2.6.7 or higher kernel and you jumpered your harddrive |
617 | If you're using a 2.6.7 or higher kernel and you jumpered your harddrive |
| 619 | because the BIOS can't handle large harddrives you'll need to append |
618 | because 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 |
| 625 | as is used for the Installation CD. For instance, if you have SCSI devices, you |
624 | as is used for the Installation CD. For instance, if you have SCSI devices, you |