Changeset 4e60ea5 for BOOK/bootable/x86
- Timestamp:
- Aug 8, 2010, 6:21:31 PM (14 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 7278ff4
- Parents:
- 6cc876e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/bootable/x86/grub.xml
r6cc876e r4e60ea5 18 18 <para os="a">Your shiny new CLFS system is almost complete. One of the last 19 19 things to do is to ensure that the system can be properly booted. The 20 instructions below apply only to computers of IA-32architecture,20 instructions below apply only to computers of x86 and x86_64 architecture, 21 21 meaning mainstream PCs. Information on <quote>boot loading</quote> for 22 22 other architectures should be available in the usual resource-specific … … 29 29 the computer if the computer becomes unusable (un-bootable).</para> 30 30 31 <para os="c">Earlier, we compiled and installed the GRUB boot loader software 32 in preparation for this step. The procedure involves writing some special 33 GRUB files to specific locations on the hard drive. We highly recommend 34 creating a GRUB boot floppy diskette as a backup. Insert a blank floppy 35 diskette and run the following commands:</para> 31 <para os="c">The first thing we need to do is generate a configuration for 32 GRUB. In previous versions of grub we could create the configuration manually 33 here, but with GRUB2 we can generate <filename>grub.cfg</filename> 34 automatically. You can do this with the following command:</para> 36 35 37 <screen os="d"><userinput>dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1 38 dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1</userinput></screen> 36 <screen os="d"><userinput>grub-mkconfig -o /boot/grub/grub.cfg</userinput></screen> 39 37 40 <para os="e">Remove the diskette and store it somewhere safe. Now, run the 41 <command>grub</command> shell:</para> 42 43 <screen os="f"><userinput>grub</userinput></screen> 44 45 <para os="g">GRUB uses its own naming structure for drives and partitions in 46 the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis> 47 is the hard drive number and <emphasis>m</emphasis> is the partition 48 number, both starting from zero. For example, partition <filename 49 class="partition">hda1</filename> is <emphasis>(hd0,0)</emphasis> to 50 GRUB and <filename class="partition">hdb3</filename> is 51 <emphasis>(hd1,2)</emphasis>. In contrast to Linux, GRUB does not 52 consider CD-ROM drives to be hard drives. For example, if using a CD 53 on <filename class="partition">hdb</filename> and a second hard drive 54 on <filename class="partition">hdc</filename>, that second hard drive 55 would still be <emphasis>(hd1)</emphasis>.</para> 56 57 <para os="h">Using the above information, determine the appropriate designator 58 for the root partition (or boot partition, if a separate one is used). 59 For the following example, it is assumed that the root (or separate boot) 60 partition is <filename class="partition">hda4</filename>.</para> 61 62 <para os="i">Tell GRUB where to search for its <filename>stage{1,2}</filename> 63 files. The Tab key can be used everywhere to make GRUB show the 64 alternatives:</para> 65 66 <screen os="j"><userinput>root (hd0,3)</userinput></screen> 67 68 <warning os="k"> 38 <warning os="w1"> 69 39 <para>The following command will overwrite the current boot loader. 70 40 Do not run the command if this is not desired, for example, if using … … 72 42 In this scenario, it would make more sense to install GRUB into the 73 43 <quote>boot sector</quote> of the CLFS partition. In this case, this 74 next command would become <userinput>setup (hd0,3)</userinput>.</para> 44 next command would become <userinput>grub-install /dev/sda2</userinput> 45 .</para> 75 46 </warning> 76 47 77 <para os=" l">Tell GRUB to install itself intothe MBR of78 <filename class="partition"> hda</filename>:</para>48 <para os="e">Instruct GRUB to install itself int othe MBR of 49 <filename class="partition">sda</filename>:</para> 79 50 80 <screen os="m"><userinput>setup (hd0)</userinput></screen> 81 82 <para os="n">If all went well, GRUB will have reported finding its files in 83 <filename class="directory">/boot/grub</filename>. That's all there is 84 to it. Quit the <command>grub</command> shell:</para> 85 86 <screen os="o"><userinput>quit</userinput></screen> 87 88 <para os="p">Create a <quote>menu list</quote> file defining GRUB's boot 89 menu:</para> 90 91 <screen><userinput>cat > /boot/grub/menu.lst << "EOF" 92 <literal># Begin /boot/grub/menu.lst 93 94 # By default boot the first menu entry. 95 default 0 96 97 # Allow 30 seconds before booting the default. 98 timeout 30 99 100 # Use prettier colors. 101 color green/black light-green/black 102 103 # The first entry is for CLFS. 104 title CLFS &version; 105 root (hd0,3) 106 kernel /boot/clfskernel-&linux-version; root=/dev/hda4</literal> 107 EOF</userinput></screen> 108 109 110 <para os="q">Add an entry for the host distribution if desired. It might look 111 like this:</para> 112 113 <screen os="r"><userinput>cat >> /boot/grub/menu.lst << "EOF" 114 <literal>title Red Hat 115 root (hd0,2) 116 kernel /boot/kernel-2.6.5 root=/dev/hda3 117 initrd /boot/initrd-2.6.5</literal> 118 EOF</userinput></screen> 119 120 <para os="s">If dual-booting Windows, the following entry will allow 121 booting it:</para> 122 123 <screen os="t"><userinput>cat >> /boot/grub/menu.lst << "EOF" 124 <literal>title Windows 125 rootnoverify (hd0,0) 126 chainloader +1</literal> 127 EOF</userinput></screen> 128 129 <para os="u">If <command>info grub</command> does not provide all necessary 130 material, additional information regarding GRUB is located on its 131 website at: <ulink url="http://www.gnu.org/software/grub/"/>.</para> 132 133 <para os="v">The FHS stipulates that the bootloader's configuration file should 134 be symlinked to <filename class="symlink">/etc/{Bootloader Name}</filename>. 135 To satisfy this requirement for GRUB, issue the following command:</para> 136 137 <screen os="w"><userinput>mkdir -v /etc/grub && 138 ln -sv /boot/grub/menu.lst /etc/grub</userinput></screen> 51 <screen os="f"><userinput>grub-install /dev/sda</userinput></screen> 139 52 140 53 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.