Permanently Changing Boot Options
You can change the options that take effect each time you boot your computer by changing the
GRUB configuration file. In Fedora and other Linux systems, GRUB configuration centers on the
/boot/grub/grub.conf file.
The /boot/grub/grub.conf file is created when you install Linux. Here’s an example of that file
for Fedora:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making# changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,6)
# kernel /vmlinuz-version ro root=/dev/sda7
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,6)/grub/splash.xpm.gz
title Fedora (2.6.20-1.3104.fc7)
root (hd0,6)
kernel /vmlinuz-2.6.20-1.3104.fc7 ro root=LABEL=/123 rhgb quiet
initrd /initrd-2.6.20-1.3104.fc7.img
title Windows XP
rootnoverify (hd0,0)
chainloader +1
The default=0 line indicates that the first partition in this list (in this case Fedora) will be the
one that is booted by default. The line timeout=10 causes GRUB to pause for 10 seconds before
booting the default partition. (That’s how much time you have to press e if you want to edit the
boot line, or to press arrow keys to select a different operating system to boot.)
The splashimage line looks in the seventh partition on the first disk (hd0,6) for the boot partition
(in this case /dev/sda7, which is the /boot partition). GRUB loads splash.xpm.gz as the
image on the splash screen (/boot/grub/splash.xpm.gz). The splash screen appears as the
background of the boot screen.
The two bootable partitions in this example are Fedora and Windows XP. The title lines for each
of those partitions are followed by the name that appears on the boot screen to represent each
partition.
For the Fedora Linux system, the root line indicates the location of the boot partition as the second
partition on the first disk. So, to find the bootable kernel (vmlinuz-2.20-1.3104.fc7) and the
initrd initial RAM disk boot image that is loaded (initrd-2.6.20-1.3104.fc7.img), GRUB
looks in the root of hd0,6 (which is represented by /dev/sda7 and is eventually mounted as
/boot). Other options on the kernel line set the partition as read-only initially (ro) and set the
root file system to LABEL=/123.
For the Windows XP partition, the rootnoverify line indicates that GRUB should not try to mount
the partition. In this case, Windows XP is on the first partition of the first hard disk (hd0,0) or
/dev/sda1. Instead of mounting the partition and passing options to the new operating system,
the chainloader +1 indicates to hand control the booting of the operating system to another
boot loader. The +1 indicates that the first sector of the partition is used as the boot loader.
If you make any changes to the /boot/grub/grub.conf file, you do not need to load those
changes. GRUB automatically picks up those changes when you reboot your computer. If you are
accustomed to using the LILO boot loader, this may confuse you at first, as LILO requires you to
rerun the lilo command for the changes to take effect.
Adding a New GRUB Boot Image
You may have different boot images for kernels that include different features. Here is the procedure
for modifying the grub.conf file:
1. Copy the new image from the directory in which it was created (such as /usr/src/
kernels/linux-2.6.20-1/arch/i386/boot) to the /boot directory. Name the file
something that reflects its contents, such as bz-2.6.20-1. For example:
# cp /usr/src/linux-2.6.20-1/arch/i386/boot/bzImage/boot/bz-2.6.20-1
2. Add several lines to the /boot/grub/grub.conf file so that the image can be started at
boot time if it is selected. For example:
title Fedora (My own IPV6 build)
root (hd0,1)
kernel /bz-2.6.20-1 ro root=/dev/sda7
initrd /initrd-2.6.20-1.img
3. Reboot your computer.
4. When the GRUB boot screen appears, move your cursor to the title representing the new
kernel and press Enter.
The advantage to this approach, as opposed to copying the new boot image over the old one, is
that if the kernel fails to boot, you can always go back and restart the old kernel. When you feel
confident that the new kernel is working properly, you can use it to replace the old kernel or perhaps
just make the new kernel the default boot definition.
Booting Your Computer with LILO
LILO stands for LInux LOader. Like other boot loaders, LILO is a program that can stand outside
the operating systems installed on the computer so you can choose which system to boot. It alsolets you give special options that modify how the operating system is booted. On Slackware and
some other Linux systems, LILO is used instead of GRUB as the default boot loader.
If LILO is being used on your computer, it is installed in either the master boot record or the first
sector of the root partition. The master boot record is read directly by the computer’s BIOS. In general,
if LILO is the only loader on your computer, install it in the master boot record. If there is
another boot loader already in the master boot record, put LILO in the root partition.
Using LILO
When your computer boots with the Fedora version of LILO installed in the master boot record, a
graphical Fedora screen appears, displaying the bootable partitions on the computer. Use the up
and down arrow keys on your keyboard to select the one you want and press Enter. Otherwise, the
default partition that you set at installation will boot after a few seconds.
If you want to add any special options when you boot, press Ctrl+X. You will see a text-based boot
prompt that appears as follows:
boot:
LILO pauses for a few seconds and then automatically boots the first image from the default bootable
partition. To see the bootable partitions again, quickly press Tab. You may see something similar to
the following:
LILO boot:
linux linux-up dos
boot:
This example shows that three bootable partitions are on your computer, called linux, linux-up,
and dos. The first two names refer to two different boot images that can boot the Linux partition.
The third refers to a bootable DOS partition (presumably containing a Windows operating system).
The first bootable partition is loaded if you don’t type anything after a few seconds. Or you can use
the name of the other partition to have that boot instead.
If you have multiple boot images, press Shift, and LILO asks you which image you want to boot.
Available boot images and other options are defined in the /etc/lilo.conf file.
Setting Up the /etc/lilo.conf File
The /etc/lilo.conf file is where LILO gets the information it needs to find and start bootable partitions
and images. By adding options to the /etc/lilo.conf file, you can change the behavior of
the boot process. The following is an example of some of the contents of the /etc/lilo.conf file:
prompt
timeout=50
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear
image=/boot/vmlinuz-18-1.2798.fc6
label=linux
initrd=/boot/initrd-2.6.18-1.2798.fc6.img
read-only
root=/dev/hda6
append=”root=LABEL=/“
other=/dev/hda1
optional
label=dos
With prompt on, the boot prompt appears when the system is booted without requiring you to
press any keys. The timeout value, in this case 50 tenths of a second (5 seconds), defines how long
to wait for keyboard input before booting the default boot image. The boot line indicates that the
bootable partition is on the hard disk represented by /dev/hda (the first IDE hard disk).
No comments:
Post a Comment