source: chapter08/grub.xml@ 1e163254

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
Last change on this file since 1e163254 was 1e163254, checked in by Alex Gronenwoud <alex@…>, 21 years ago

Correcting several typos and some inconsistencies.

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

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