source: chapter08/grub.xml@ 1770019

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
Last change on this file since 1770019 was 1770019, checked in by Matthew Burgess <matthew@…>, 19 years ago

Upgraded to DocBook 4.4 DTD

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

  • Property mode set to 100644
File size: 2.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-bootable-grub">
7<title>Making the LFS System Bootable</title>
8<?dbhtml filename="grub.html"?>
9
10
11<para>We highly recommend that you create a Grub boot floppy diskette just in case.
12Insert a blank floppy diskette and run the following commands:</para>
13
14<screen><userinput>dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
15dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1</userinput></screen>
16
17<para>Remove the diskette and store it somewhere safe. Now we'll run the
18<command>grub</command> shell:</para>
19
20<screen><userinput>grub</userinput></screen>
21
22<para>First, tell Grub where to search for its <filename>stage{1,2}</filename>
23files -- you can use the Tab key everywhere to make Grub show the alternatives:</para>
24
25<screen><userinput>root (hd0,3)</userinput></screen>
26
27<para>Tell Grub to install itself into the MBR (Master Boot Record) of
28<filename class="partition">hda</filename>:</para>
29
30<screen><userinput>setup (hd0)</userinput></screen>
31
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>
34
35<screen><userinput>quit</userinput></screen>
36
37<para>Now we need to create a <quote>menu list</quote> file, defining Grub's
38boot menu:</para>
39
40<screen><userinput>cat &gt; /boot/grub/menu.lst &lt;&lt; "EOF"
41<literal># Begin /boot/grub/menu.lst
42
43# By default boot the first menu entry.
44default 0
45
46# Allow 30 seconds before booting the default.
47timeout 30
48
49# Use prettier colors.
50color green/black light-green/black
51
52# The first entry is for LFS.
53title LFS &version;
54root (hd0,3)
55kernel /boot/lfskernel-&linux-version; root=/dev/hda4</literal>
56EOF</userinput></screen>
57
58<para>You may want to add an entry for your host distribution. It might look
59like this:</para>
60
61<screen><userinput>cat &gt;&gt; /boot/grub/menu.lst &lt;&lt; "EOF"
62<literal>title Red Hat
63root (hd0,2)
64kernel /boot/kernel-2.4.20 root=/dev/hda3
65initrd /boot/initrd-2.4.20</literal>
66EOF</userinput></screen>
67
68<para>Also, if you happen to dual-boot Windows, the following entry should
69allow booting it:</para>
70
71<screen><userinput>cat &gt;&gt; /boot/grub/menu.lst &lt;&lt; "EOF"
72<literal>title Windows
73rootnoverify (hd0,0)
74chainloader +1</literal>
75EOF</userinput></screen>
76
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
79command:</para>
80
81<screen><userinput>mkdir /etc/grub &amp;&amp;
82ln -s /boot/grub/menu.lst /etc/grub</userinput></screen>
83
84</sect1>
Note: See TracBrowser for help on using the repository browser.