Changeset 1561534


Ignore:
Timestamp:
09/12/2003 12:47:51 AM (21 years ago)
Author:
Jeremy Utley <jeremy@…>
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.0, 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, v5_0, v5_1, v5_1_1, 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:
7064daf
Parents:
955533b
Message:

Added Grub instructions for installing to MBR

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

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chapter01/changelog.xml

    r955533b r1561534  
    8888</para></listitem>
    8989
     90<listitem><para>September 11th, 2003 [jeremy]: Added bootloader setup to
     91Chapter 8, after the addition of Grub to the book.</para></listitem>
     92
    9093<listitem><para>September 11th, 2003 [gerard]: Removed Bin86 and LILO and
    9194replaced it with Grub.</para></listitem>
  • chapter08/grub.xml

    r955533b r1561534  
    33<?dbhtml filename="grub.html" dir="chapter08"?>
    44
    5 <para>(To be filled in)</para>
     5<para>Now that we have our shiny new LinuxFromScratch system completed,
     6we need to ensure we can boot it.  To do this, we will run the grub program.</para>
     7
     8<para><screen><userinput>grub</userinput></screen></para>
     9
     10<para>Grub uses it's own naming structure for drives, in the form of hd(a,b),
     11where a is the hard drive number, and b is the partition number, both of which
     12start from zero.  So, partition hda1 would be hd(0,0) to grub, and hdb2 would
     13be hd(1,2).  Also, Grub doesn't pay attention to CDROM drives at all, so if,
     14for example, if you have a CD on hdb, and a second hard drive on hdc, partitions
     15on that second hard drive would still be hd(1,b).</para>
     16
     17<para>So, using the information above, select the appropriate designator for
     18your root partition.  For the purposes of this, we will assume hd(0,3) for
     19your root partition.  First, we tell grub where to find it's files:</para>
     20
     21<para><screen><userinput>root (hd0,3)
     22setup (hd0)
     23quit</userinput></screen></para>
     24
     25<para>This tells grub to look for it's files on hda4 (hd0,3), and install itself
     26into the MBR (Master Boot Record) of hda.</para>
     27
     28<para>Also, we need to create the <filename>menu.lst</filename> file, which
     29Grub uses to designate it's boot menu:</para>
     30
     31<para><screen><userinput>cat > /boot/grub/menu.lst << "EOF"
     32# Begin /boot/grub/menu.lst
     33
     34# Default to first menu entry
     35default 0
     36
     37# Allow 30 seconds before booting default
     38timeout 30
     39
     40# Use prettier colors
     41color green/black light-green/black
     42
     43# Default Entry for LFS
     44title LFS 5.0
     45kernel (hd0,3)/boot/lfskernel root=/dev/hda4 ro
     46EOF</userinput></screen></para>
     47
     48<para>You might also want to add in an entry for your host distribution.  It
     49might look similar to this:</para>
     50
     51<para><screen><userinput>cat >> /boot/grub/menu.lst << "EOF"
     52# Redhat Linux
     53title Redhat
     54kernel (hd0,2)/boot/kernel-2.4.20 root=/dev/hda3 ro
     55initrd (hd0,2)/boot/initrd-2.4.20
     56EOF</userinput></screen></para>
     57
     58<para>Also, if you happen to dual-boot Windows, the following entry should
     59allow booting it:</para>
     60
     61<para><screen><userinput>cat >> /boot/grub/menu.lst << "EOF"
     62# Windows
     63chainloader (hd0,0)+1
     64EOF</userinput></screen></para>
     65
     66<para>You can find more info regarding Grub on it's web site, located at:
     67<ulink url="http://www.gnu.org/software/grub"/>, as well as the LFS Grub HOWTO
     68located at: <ulink url="http://www.linuxfromscratch.org/hints/downloads/files/grub-howto.txt"/>.</para>
    669
    770</sect1>
Note: See TracChangeset for help on using the changeset viewer.