Linux Application Development For The Enterprise (Charles River Media Programming)

 < Day Day Up > 


If you have an installed Linux system such as Red Hat 8.0 or 9.0 or SuSe 8.1 or 8.2, normally you don’t have to worry about the boot parameters, as the booting process with these releases is very smooth and efficiently handled. The discussion in this section is only to help you understand that the Linux boot loaders and the kernel accept boot parameters, which you enter manually during the boot process.

The Linux boot parameters provide additional information externally, before the kernel is booted. In a typical Linux system, the kernel is booted through the boot loader program LILO or GRUB. Therefore, the Linux boot parameters may also be called by different names, such as LILO parameters, GRUB parameters, or boot loader parameters. If you are using LILO boot loader, the LILO configuration information file is created during installation and may be modified after installation. This file contains the list of all the operating systems installed on the computer and the partitions from which they should be booted. The boot parameters are entered manually at the LILO boot prompt or may be stored in the LILO configuration file, or you may do it both ways if you are using LILO boot loader. At the LILO boot prompt, you may enter the system label (that represents the operating system) followed by any arguments that the operating system accepts, as shown in the sample commands below.

LILO: linux root=/dev/hda1 LILO: windows

In the above example, the first line indicates that the system labels linux and windows are described in the LILO configuration file to represent the Linux and Windows operating systems, respectively. You may give any names to these labels in the configuration file. When you type the linux system label, LILO tries to boot the Linux operating system. The argument root=/dev/hda1 is passed to the kernel, which interprets that the /dev/hda1 file system should be used as the root file system while booting.

On the other hand, GRUB is a more advanced boot loader and presents the user with a pre-boot command line environment (if the user so chooses while booting), making the booting process very flexible. The GRUB configuration information is stored in the /boot/grub/grub.conf file, and a link to this file is created with the name /boot/grub/menu.lst. The information in this file is saved in the MBR (or wherever the boot loader is saved) and is used to display the list of operating systems while booting. Listing 2.2 displays how a typical GRUB configuration file looks. In this listing, multiple entries for Linux indicate that we can boot different Linux kernel versions as we require. Normally if the kernel is upgraded through the Red Hat Upgrade Agent, these entries are automatically added by the Agent. This gives us the option of booting different kernel versions. Every time a change is made to this configuration file, it is necessary to reinstall the GRUB boot loader using a command similar to the one shown here. The first line is the syntax of the general command line, while the second line indicates that the boot loader is installed in the MBR of the primary master hard drive, /dev/hda.

[root@etslinux root] grub-install <device> [root@etslinux root] grub-install /dev/hda

Listing 2.2

default=0 timeout=10 splashimage=(hd0,2)/boot/grub/splash.xpm.gz title Red Hat Linux (2.4.20-9) root (hd0,2) kernel /boot/vmlinuz-2.4.20-9 ro root=LABEL=/ hdc=ide-scsi hdd=ide- scsi initrd /boot/initrd-2.4.20-9.img title Red Hat Linux (2.4.20-8) root (hd0,2) kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi hdd=ide- scsi initrd /boot/initrd-2.4.20-8.img title Red Hat Linux (2.4.20-6) root (hd0,2) kernel /boot/vmlinuz-2.4.20-6 ro root=LABEL=/ hdc=ide-scsi hdd=ide- scsi initrd /boot/initrd-2.4.20-6.img title windows rootnoverify (hd0,0) chainloader +1

From the list of operating systems displayed by GRUB, highlight the item that represents your Linux system using the up and down arrow keys. Next, you may type the letter ‘e’ to edit the boot command, or ‘a’ to append to the boot command, or ‘c’ to display the GRUB command line. In all these cases, you will have the opportunity to enter or edit the boot parameters. However, the GRUB command line is slightly different. It is not the operating system command line. Rather, it is a command line environment before booting to the operating system, or pre-boot command line. At the GRUB command line, you can enter the complete boot command, with required arguments. The boot parameters are useful in different ways. If you fail to boot the Linux system for any reason, you may choose to indicate to the boot loader that you want to boot in single user mode, which permits you to login as administrator, providing you the opportunity to fix the problem causing the boot failure. You may also provide device-specific information in the boot parameters.

Now, we will discuss another typical scenario, one where a Linux operating system shares the primary master hard disk drive with more than one version of Windows operating systems. For example, let us consider the cases of installing Windows 2000 (Server or Professional), Windows XP (or Windows .NET Server 2003), and finally Linux (any clone of Linux). To perform such a typical installation, it is always best to install both the Windows operating systems first and then the Linux operating system, because when Windows operating systems are installed, the MBR is overwritten by the Windows installation program, and during the installation of Linux, the GRUB boot manager is configured to display the Windows partition in the list of choices available for booting. The Windows installation program provides a list that contains only Windows operating systems and not Linux. Therefore, it is necessary that Linux be installed as the last operating system as this provides a way to boot every operating system on the computer, through the GRUB boot manager. When multiple versions of Windows operating systems are installed, Windows keeps this list in the boot sector of the first partition, which is different from the MBR.


 < Day Day Up > 

Категории