1 TITLE: GRUB Boot & Rescue Disk - HOWTO
3 AUTHOR: Daniel Armstrong <daniel_armstrong@sympatico.ca>
6 GRUB is the GRand Unified Bootloader, a boot loader program with many
7 cool features for the PC. It serves as a replacement for the more traditional
8 LILO. This hint shows how to use GRUB to make a combined boot loader and rescue
9 disk for your LFS system.
12 If you do not currently have GRUB installed on your system, you will need to
13 download the most recent version (ftp://alpha.gnu.org/gnu/grub/grub-0.90.tar.gz)
14 and install it into your chosen working directory.
16 Now we unpack GRUB and install it on our system with the following commands:
18 tar xvzf grub-0.90.tar.gz
20 ./configure --prefix=/usr
24 This will create the necessary executables and support files to create our boot
27 Grab a spare floppy and do a fresh format and install a filesystem:
32 Now we need to mount our soon-to-be GRUB disk:
34 mount -t ext2 /dev/fd0 /mnt
36 Create the directory and install the files GRUB will need to serve as your boot
39 mkdir -p /mnt/boot/grub
40 cp /usr/share/grub/i386-pc/stage1 /mnt/boot/grub
41 cp /usr/share/grub/i386-pc/stage2 /mnt/boot/grub
43 Now we are going to setup our GRUB floppy to do double-duty as a rescue disk
44 for our LFS system, by placing a copy of the kernel on our floppy. This way if
45 kernel on the hard drive is ever corrupted or trashed, we can use our GRUB boot
46 and rescue disk to get our system up and running again.
48 Copy your kernel to the GRUB floppy:
50 cp /boot/vmlinuz-2.4.7 /mnt/boot #Your kernel and location may vary.
52 The final step before we reboot and test our GRUB boot and rescue disk is to
53 install the GRUB tools in the Master Boot Record (MBR) of the floppy. Unmount
54 the floppy but leave it in the drive:
58 Now type at the command prompt:
62 This starts up the GRUB shell environment and changes your # prompt to "grub>".
69 Your GRUB boot and rescue disk is now complete. Leave the floppy in the drive
70 and reboot. When the GRUB shell returns type:
73 kernel /boot/vmlinuz-2.4.7 root=/dev/hda3 #Replace MY boot image and root
74 #partition with your own
77 Voila! Your LFS system should be up and running now.
79 For a more complete description of GRUB's many features, configuration, and
80 installing GRUB on your hard drive's MBR, see the "Grub-HOWTO" hint at the
81 LFS-Hints website and/or type "info grub" at your command prompt.
83 Thanks to Fabio Fracassi, the author of the "GRUB-Howto" hint, for getting me
86 August 2, 2001 Daniel Armstrong <daniel_armstrong@sympatico.ca>