Changeset 1dc34de7 for chapter08/grub.xml
- Timestamp:
- 08/08/2004 02:11:37 AM (20 years ago)
- Branches:
- 6.0
- Children:
- dbc195c
- Parents:
- 5ba3d1d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter08/grub.xml
r5ba3d1d r1dc34de7 12 12 <secondary>configuring</secondary></indexterm> 13 13 14 <para>Your shiny new LFS system is almost complete. One of the last things to 15 do is ensure you can boot it. The instructions below apply only to computers of 16 IA-32 architecture, meaning mainstream PCs. Information on <quote>boot 17 loading</quote> for other architectures should be available in the usual 18 resource-specific locations for those architectures.</para> 14 <para>Your shiny new LFS system is almost complete. One of the last 15 things to do is ensure that it can be properly booted. The 16 instructions below apply only to computers of IA-32 architecture, 17 meaning mainstream PCs. Information on <quote>boot loading</quote> for 18 other architectures should be available in the usual resource-specific 19 locations for those architectures.</para> 19 20 20 <para>Boot loading can be a complex area. First, a few cautionary words. You21 really should be familiar with yourcurrent boot loader and any other22 operating systems present on your hard drive(s) that you might wish to keep23 bootable. Please make sure that you have an emergency boot disk ready, so that24 you can rescue your computer if, by any chance, your computer becomes unusable 25 (un-bootable).</para>21 <para>Boot loading can be a complex area. First, a few cautionary 22 words. Be familiar with the current boot loader and any other 23 operating systems present on the hard drive(s) that need to be 24 bootable. Please make sure that an emergency boot disk is ready to 25 <quote>rescue</quote> the computer if, by chance, the computer becomes 26 unusable (un-bootable).</para> 26 27 27 <para>Earlier, we compiled and installed the Grub boot loader software in28 preparation for this step. The procedure involves writing some special Grub 29 files to specific locations on the hard drive. Before we get to that, we 30 highly recommend that you create a Grub boot floppy diskette just in case. 31 Insert ablank floppy diskette and run the following commands:</para>28 <para>Earlier, we compiled and installed the Grub boot loader software 29 in preparation for this step. The procedure involves writing some 30 special Grub files to specific locations on the hard drive. We highly 31 recommend a Grub boot floppy diskette be created as a backup. Insert a 32 blank floppy diskette and run the following commands:</para> 32 33 33 34 <screen><userinput>dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1 34 35 dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1</userinput></screen> 35 36 36 <para>Remove the diskette and store it somewhere safe. Now we'llrun the37 <para>Remove the diskette and store it somewhere safe. Now, run the 37 38 <command>grub</command> shell:</para> 38 39 39 40 <screen><userinput>grub</userinput></screen> 40 41 41 <para>Grub uses its own naming structure for drives and partitions, in the form 42 of (hdn,m), where <emphasis>n</emphasis> is the hard drive number, and 43 <emphasis>m</emphasis> the partition number, both starting from zero. This 44 means, for instance, that partition <filename class="partition">hda1</filename> is (hd0,0) to 45 Grub, and <filename class="partition">hdb2</filename> is (hd1,1). In contrast to Linux, Grub 46 doesn't consider CD-ROM drives to be hard drives, so if you have a CD on 47 <filename class="partition">hdb</filename>, for example, and a second hard drive on 48 <filename class="partition">hdc</filename>, that second hard drive would still be (hd1).</para> 42 <para>Grub uses its own naming structure for drives and partitions, in 43 the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis> 44 is the hard drive number and <emphasis>m</emphasis> is the partition 45 number, both starting from zero. For example, partition <filename 46 class="partition">hda1</filename> is <emphasis>(hd0,0)</emphasis> to 47 Grub, and <filename class="partition">hdb3</filename> is 48 <emphasis>(hd1,2)</emphasis>. In contrast to Linux, Grub does not 49 consider CD-ROM drives to be hard drives. For example, if using a CD 50 on <filename class="partition">hdb</filename> and a second hard drive 51 on <filename class="partition">hdc</filename>, that second hard drive 52 would still be <emphasis>(hd1)</emphasis>.</para> 49 53 50 <para>Using the above information, determine the appropriate designator for 51 your root partition (or boot partition, if you use a separate one). For the 52 following example, we'll assume your root (or separate boot) partition is 53 <filename class="partition">hda4</filename>.</para> 54 <para>Using the above information, determine the appropriate 55 designator for the root partition (or boot partition, if a separate 56 one is used). For the following example, it is assumed that the root 57 (or separate boot) partition is <filename 58 class="partition">hda4</filename>.</para> 54 59 55 <para>First, tell Grub where to search for its <filename>stage{1,2}</filename> 56 files -- you can use the Tab key everywhere to make Grub show the alternatives:</para> 60 <para>First, tell Grub where to search for its 61 <filename>stage{1,2}</filename> files. The Tab key can be used 62 everywhere to make Grub show the alternatives:</para> 57 63 58 64 <screen><userinput>root (hd0,3)</userinput></screen> 59 65 60 61 <warning><para>The following command will overwrite your current boot loader. 62 Don't run the command if this is not what you want. For example, you may be 63 using a third party boot manager to manage your MBR (Master Boot Record). In 64 this scenario, it would probably make more sense to install Grub into the 65 <quote>boot sector</quote> of the LFS partition, in which case this next command 66 would become: <userinput>setup (hd0,3)</userinput>.</para></warning> 67 66 <warning><para>The following command will overwrite the current boot 67 loader. Do not run the command if this is not desired, for example, if 68 using a third party boot manager to manage the Master Boot Record 69 (MBR). In this scenario, it would probably make more sense to install 70 Grub into the <quote>boot sector</quote> of the LFS partition. In this 71 case, this next command would become: <userinput>setup 72 (hd0,3)</userinput>.</para></warning> 68 73 69 74 <para>Tell Grub to install itself into the MBR (Master Boot Record) of … … 72 77 <screen><userinput>setup (hd0)</userinput></screen> 73 78 74 <para>If all is well, Grub will have reported finding its files in 75 <filename class="directory">/boot/grub</filename>. That's all there is to it:</para> 79 <para>If all went well, Grub will have reported finding its files in 80 <filename class="directory">/boot/grub</filename>. That's all there is 81 to it. Quit the <command>grub</command> shell:</para> 76 82 77 83 <screen><userinput>quit</userinput></screen> 78 84 79 <para>Now we need to create a <quote>menu list</quote> file, defining Grub's 80 boot menu:</para> 85 <para>Create a <quote>menu list</quote> file defining Grub's boot menu:</para> 81 86 82 87 <screen><userinput>cat > /boot/grub/menu.lst << "EOF" … … 98 103 EOF</userinput></screen> 99 104 100 <para> You may want to add an entry for your host distribution. It might look105 <para>Add an entry for the host distribution if desired. It might look 101 106 like this:</para> 102 107 … … 108 113 EOF</userinput></screen> 109 114 110 <para>Also, if you happen to dual-boot Windows, the following entry should111 allowbooting it:</para>115 <para>Also, if dual-booting Windows, the following entry will allow 116 booting it:</para> 112 117 113 118 <screen><userinput>cat >> /boot/grub/menu.lst << "EOF" … … 117 122 EOF</userinput></screen> 118 123 119 <para>If <command>info grub</command> does n't tell you all you want to120 know, you can find more information regarding Grub on its website, locatedat:124 <para>If <command>info grub</command> does not provide all necessary material, additional 125 information regarding Grub is located on its website at: 121 126 <ulink url="http://www.gnu.org/software/grub/"/>.</para> 122 127 123 128 </sect1> 129
Note:
See TracChangeset
for help on using the changeset viewer.