Changeset 81fd230 for chapter08/grub.xml


Ignore:
Timestamp:
02/19/2005 10:16:42 PM (19 years ago)
Author:
Gerard Beekmans <gerard@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
3d31fc4
Parents:
2f9131f
Message:

Trunk is now identical to Testing

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4648 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter08/grub.xml

    r2f9131f r81fd230  
    88<?dbhtml filename="grub.html"?>
    99
     10<indexterm zone="ch-bootable-grub">
     11<primary sortas="a-Grub">Grub</primary>
     12<secondary>configuring</secondary></indexterm>
    1013
    11 <para>We highly recommend that you create a Grub boot floppy diskette just in case.
    12 Insert a blank floppy diskette and run the following commands:</para>
     14<para>Your shiny new LFS system is almost complete. One of the last
     15things to do is to ensure that the system can be properly booted. The
     16instructions below apply only to computers of IA-32 architecture,
     17meaning mainstream PCs. Information on <quote>boot loading</quote> for
     18other architectures should be available in the usual resource-specific
     19locations for those architectures.</para>
     20
     21<para>Boot loading can be a complex area, so a few cautionary
     22words are in order. Be familiar with the current boot loader and any other
     23operating systems present on the hard drive(s) that need to be
     24bootable. Make sure that an emergency boot disk is ready to
     25<quote>rescue</quote> the computer if the computer becomes
     26unusable (un-bootable).</para>
     27
     28<para>Earlier, we compiled and installed the Grub boot loader software
     29in preparation for this step. The procedure involves writing some
     30special Grub files to specific locations on the hard drive. We highly
     31recommend creating a Grub boot floppy diskette as a backup. Insert a
     32blank floppy diskette and run the following commands:</para>
    1333
    1434<screen><userinput>dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
    1535dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1</userinput></screen>
    1636
    17 <para>Remove the diskette and store it somewhere safe. Now we'll run the
     37<para>Remove the diskette and store it somewhere safe. Now, run the
    1838<command>grub</command> shell:</para>
    1939
    2040<screen><userinput>grub</userinput></screen>
    2141
    22 <para>First, tell Grub where to search for its <filename>stage{1,2}</filename>
    23 files -- you can use the Tab key everywhere to make Grub show the alternatives:</para>
     42<para>Grub uses its own naming structure for drives and partitions in
     43the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis>
     44is the hard drive number and <emphasis>m</emphasis> is the partition
     45number, both starting from zero. For example, partition <filename
     46class="partition">hda1</filename> is <emphasis>(hd0,0)</emphasis> to
     47Grub and <filename class="partition">hdb3</filename> is
     48<emphasis>(hd1,2)</emphasis>. In contrast to Linux, Grub does not
     49consider CD-ROM drives to be hard drives. For example, if using a CD
     50on <filename class="partition">hdb</filename> and a second hard drive
     51on <filename class="partition">hdc</filename>, that second hard drive
     52would still be <emphasis>(hd1)</emphasis>.</para>
     53
     54<para>Using the above information, determine the appropriate
     55designator for the root partition (or boot partition, if a separate
     56one is used). For the following example, it is assumed that the root
     57(or separate boot) partition is <filename
     58class="partition">hda4</filename>.</para>
     59
     60<para>Tell Grub where to search for its
     61<filename>stage{1,2}</filename> files. The Tab key can be used
     62everywhere to make Grub show the alternatives:</para>
    2463
    2564<screen><userinput>root (hd0,3)</userinput></screen>
    2665
    27 <para>Tell Grub to install itself into the MBR (Master Boot Record) of
     66<warning><para>The following command will overwrite the current boot
     67loader. Do not run the command if this is not desired, for example, if
     68using a third party boot manager to manage the Master Boot Record
     69(MBR). In this scenario, it would make more sense to install
     70Grub into the <quote>boot sector</quote> of the LFS partition. In this
     71case, this next command would become <userinput>setup
     72(hd0,3)</userinput>.</para></warning>
     73
     74<para>Tell Grub to install itself into the MBR of
    2875<filename class="partition">hda</filename>:</para>
    2976
    3077<screen><userinput>setup (hd0)</userinput></screen>
    3178
    32 <para>If all is well, Grub will have reported finding its files in
    33 <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
     81to it. Quit the <command>grub</command> shell:</para>
    3482
    3583<screen><userinput>quit</userinput></screen>
    3684
    37 <para>Now we need to create a <quote>menu list</quote> file, defining Grub's
    38 boot menu:</para>
     85<para>Create a <quote>menu list</quote> file defining Grub's boot menu:</para>
    3986
    4087<screen><userinput>cat &gt; /boot/grub/menu.lst &lt;&lt; "EOF"
     
    56103EOF</userinput></screen>
    57104
    58 <para>You may want to add an entry for your host distribution. It might look
     105<para>Add an entry for the host distribution if desired. It might look
    59106like this:</para>
    60107
     
    66113EOF</userinput></screen>
    67114
    68 <para>Also, if you happen to dual-boot Windows, the following entry should
    69 allow booting it:</para>
     115<para>If dual-booting Windows, the following entry will allow
     116booting it:</para>
    70117
    71118<screen><userinput>cat &gt;&gt; /boot/grub/menu.lst &lt;&lt; "EOF"
     
    75122EOF</userinput></screen>
    76123
    77 <para>The FHS stipulates that Grub's menu.lst file should be symlinked to
    78 /etc/grub/menu.lst.  To satisfy this requirement, issue the following
    79 command:</para>
     124<para>If <command>info grub</command> does not provide all necessary material, additional
     125information regarding Grub is located on its website at:
     126<ulink url="http://www.gnu.org/software/grub/"/>.</para>
     127
     128<para>The FHS stipulates that Grub's <filename>menu.lst</filename> file should be symlinked to
     129<filename class="symlink">/etc/grub/menu.lst</filename>.  To satisfy this requirement, issue the
     130following command:</para>
    80131
    81132<screen><userinput>mkdir /etc/grub &amp;&amp;
     
    83134
    84135</sect1>
     136
Note: See TracChangeset for help on using the changeset viewer.