Changeset 54ff0b9
- Timestamp:
- 10/08/2003 10:31:01 PM (21 years ago)
- 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:
- c1e4223
- Parents:
- 4b8a426
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter08/grub.xml
r4b8a426 r54ff0b9 9 9 <para><screen><userinput>grub</userinput></screen></para> 10 10 11 <para>Grub uses its own naming structure for drives, in the form of (hdn,m), 12 where n is the hard drive number, and m is the partition number, both of which 13 start from zero. So, partition hda1 would be (hd0,0) to Grub, and hdb2 would 14 be (hd1,1). Also, Grub doesn't pay attention to CD-ROM drives at all, so if, 15 for example, you have a CD on hdb, and a second hard drive on hdc, partitions 16 on that second hard drive would still be (hd1,m).</para> 11 <para>Grub uses its own naming structure for drives and partitions, in the form 12 of (hdn,m), where <emphasis>n</emphasis> is the hard drive number, and 13 <emphasis>m</emphasis> the partition number, both starting from zero. This 14 means, for instance, that partition <filename>hda1</filename> is (hd0,0) to 15 Grub, and <filename>hdb2</filename> is (hd1,1). In contrast to Linux, Grub 16 doesn't consider CD-ROM drives to be hard drives, so if you have a CD on 17 <filename>hdb</filename>, for example, and a second hard drive on 18 <filename>hdc</filename>, that second hard drive would still be (hd1).</para> 17 19 18 <para> So, using the information above, selectthe appropriate designator for19 your root partition. For the purposes of this, we will assume (hd0,3) for20 your root partition. First, we tell grub where to find its files:</para>20 <para>Using the above information, determine the appropriate designator for 21 your root partition. For the folowing example, we'll assume your root partition 22 is <filename>hda4</filename>.</para> 21 23 22 <para><screen><userinput>root (hd0,3) 23 setup (hd0) 24 quit</userinput></screen></para> 24 <para>First, tell Grub where to search for its <filename>stage{1,2}</filename> 25 files -- you can use Tab everywhere to make Grub show the alternatives:</para> 25 26 26 <para>This tells Grub to look for its files on hda4 (hd0,3), and install itself 27 into the MBR (Master Boot Record) of hda.</para> 27 <para><screen><userinput>root (hd0,3)</userinput></screen></para> 28 28 29 <para> Also, we need to create the <filename>menu.lst</filename> file, which30 Grub uses to designate its boot menu:</para>29 <para>Then tell it to install itself into the MBR (Master Boot Record) of 30 <filename>hda</filename>:</para> 31 31 32 <para><screen><userinput>cat > /boot/grub/menu.lst << "EOF" 32 <para><screen><userinput>setup (hd0)</userinput></screen></para> 33 34 <para>If all is well, Grub will have reported finding its files in 35 <filename>/boot/grub</filename>. That's all there was to it:</para> 36 37 <para><screen><userinput>quit</userinput></screen></para> 38 39 <para>Now we need to create the <filename>menu.lst</filename> file, which 40 defines Grub's boot menu:</para> 41 42 <para><screen><userinput>cat > /boot/grub/menu.lst << "EOF"</userinput> 33 43 # Begin /boot/grub/menu.lst 34 44 35 # Default to first menu entry45 # By default boot the first menu entry. 36 46 default 0 37 47 38 # Allow 30 seconds before booting default48 # Allow 30 seconds before booting the default. 39 49 timeout 30 40 50 41 # Use prettier colors 51 # Use prettier colors. 42 52 color green/black light-green/black 43 53 44 # Default Entry for LFS54 # The first entry is for LFS. 45 55 title LFS 5.0 46 56 root (hd0,3) 47 57 kernel /boot/lfskernel root=/dev/hda4 ro 48 EOF</userinput></screen></para>58 <userinput>EOF</userinput></screen></para> 49 59 50 <para>You m ight also want to add in an entry for your host distribution. It51 might look similar tothis:</para>60 <para>You may want to add an entry for your host distribution. It might look 61 like this:</para> 52 62 53 <para><screen><userinput>cat >> /boot/grub/menu.lst << "EOF" 54 # Redhat Linux 55 title Redhat 63 <para><screen><userinput>cat >> /boot/grub/menu.lst << "EOF"</userinput> 64 title Red Hat 56 65 root (hd0,2) 57 66 kernel /boot/kernel-2.4.20 root=/dev/hda3 ro 58 67 initrd /boot/initrd-2.4.20 59 EOF</userinput></screen></para>68 <userinput>EOF</userinput></screen></para> 60 69 61 70 <para>Also, if you happen to dual-boot Windows, the following entry should 62 71 allow booting it:</para> 63 72 64 <para><screen><userinput>cat >> /boot/grub/menu.lst << "EOF" 65 # Windows 73 <para><screen><userinput>cat >> /boot/grub/menu.lst << "EOF"</userinput> 66 74 title Windows 67 75 rootnoverify (hd0,0) 68 76 chainloader +1 69 EOF</userinput></screen></para>77 <userinput>EOF</userinput></screen></para> 70 78 71 <para>You can find more information regarding Grub on its website, located at: 79 <para>If <userinput>info grub</userinput> doesn't tell you all you want to 80 know, you can find more information regarding Grub on its website, located at: 72 81 <ulink url="http://www.gnu.org/software/grub"/>.</para> 73 82
Note:
See TracChangeset
for help on using the changeset viewer.