Sunday, May 24, 2009

Define LILO's boot option..??

HOME PAGE

Appendix G. LILO Boot Options

The most popular way to boot Linux on Intel platforms is the LInux LOader, LILO, whose configuration and use are described in the sectionx. This appendix summarizes the options you can specify in the /etc/lilo.conf file and on the /sbin/lilo command line.

The configuration file starts with a section of global options, described in the next section. Global options are those that apply to every system boot, regardless of what operating system you are booting.

Following the global section, there is one section of options for each Linux kernel. While the variety of kernel options--many of them hardware specific--make it unfeasible to list them all here.

Finally, the configuration file contains a section for each non-Linux operating system that you want LILO to be able to boot. Each of those sections is referred to as an image section, because each boots a different kernel imageor another operating system. Each Linux image section begins with an image= line.

1. Global Options

In addition to the options listed here, the kernel options append, read-only, read-write, root, and vga can also be set as global options:

backup=backup-file

Copies the original boot sector to backup-file instead of to the file /boot/boot.nnnn, where nnnn is a number that depends on the disk device type.

boot=boot-device

Sets the name of the device that contains the boot sector. boot defaults to the device currently mounted as the root, such as /dev/hda2. Specifying a device, such as /dev/hda, indicates that LILO should be installed in the master boot record; the alternative is to set it up on a particular partition, such as /dev/hda2.

compact

Merges read requests for adjacent disk sectors to speed up booting. Use of compact is particularly recommended when booting from a floppy disk.

default=name

Uses the image name as the default boot image. If default is omitted, the first image specified in the configuration file is used.

delay=tsecs

Specifies, in tenths of a second, how long the boot loader should wait before booting the default image. If serial is set, delay is set to 20 at a minimum. The default is not to wait.

disk=device-name

Defines parameters for the disk specified by device-name if LILO can't figure them out. Normally, LILO can determine the disk parameters itself and this option isn't needed. When disk is specified, it is followed by one or more parameter lines:

disk=/dev/sda
  bios = 0x80  # First disk is usually 0x80, second is usually 0x81
  sectors= ...
  heads= ...

bios=bios-device-code

Specifies the number the BIOS uses to refer to the device. See the previous example.

cylinders=cylinders

Specifies the number of cylinders on the disk.

heads=heads

Specifies the number of heads on the disk.

inaccessible

Tells LILO that the BIOS can't read the disk; this option is used to prevent the system from becoming unbootable if LILO thinks the BIOS can read it.

partition=partition-device

Starts a new section for a partition. The section contains one variable,

start=partition-offset that specifies the zero-based number of the first sector of the partition:

        partition=/dev/sda1
        start=2048

sectors=sectors

Specifies the number of sectors per track.

disktab=disktab-file

Superceded by the disk= option.

fix-table

If set, allows LILO to adjust 3D addresses (addresses specified as sector/head/cylinder) in partition tables. This is sometimes necessary if a partition isn't track aligned and another operating system, such as MS-DOS, is on the same disk. See the lilo.conf manpage for details.

force-backup=backup-file

Is like backup, but overwrites an old backup copy if one exists.

ignore-table

Tells LILO to ignore corrupt partition tables.

install=boot-sector

Installs the specified file as the new boot sector. If install is omitted, the boot sector defaults to /boot/boot.b.

linear

Generates linear sector addresses, which do not depend on disk geometry, instead of 3D (sector/head/cylinder) addresses. If LILO can't determine your disk's geometry itself, you can try using linear; if that doesn't work, then you need to specify the geometry with disk=. Note, however, that linear sometimes doesn't work with floppy disks, and it may conflict with compact.

map=map-file

Specifies the location of the map file. Defaults to /boot/map.

message=message-file

Specifies a file containing a message to be displayed before the boot prompt. The message can include a formfeed character (Ctrl-L) to clear the screen. The map file must be rebuilt by rerunning the lilo command if the message file is changed or moved. The maximum length of the file is 65,535 bytes.

nowarn

Disables warning messages.

optional

Specifies that any image that is not available when the map is created should be omitted and not offered as an option at the boot prompt. Like the per-image option optional, but it applies to all images.

password=password

Specifies a password that the user is prompted to enter when trying to load an image. The password is not encrypted in the configuration file, so if passwords are used, permissions should be set so that only the superuser is able to read the file. This option is like the per-image password option, except that all images are password protected and they all have the same password.

prompt

Automatically displays the boot prompt without waiting for the user to press the Shift, Alt, or Scroll Lock key. Note that setting prompt without also setting timeout prevents unattended reboots.

restricted

Can be used with password to indicate that a password needs to be entered only if the user specifies parameters on the command line. It is like the per-image restricted option, but applies to all images.

serial=parameters

Allows the boot loader to accept input from a serial line as well as from the keyboard. Sending a break on the serial line corresponds to pressing a Shift key on the console to get the boot loader's attention. All boot images should be password protected if serial access is insecure (e.g., if the line is connected to a modem). Setting serial automatically raises the value of delay to 20 (i.e., two seconds) if it is less than that. The parameter string parameters has the following syntax:

port[,bps[parity[bits]]]

For example, to initialize COM1 with the default parameters:

serial=0,2400n8

The parameters are:

timeout=tsecs

Sets a timeout (specified in tenths of a second) for keyboard input. If no key has been pressed after the specified time, the default image is automatically booted. timeout is also used to determine when to stop waiting for password input. The default timeout is infinite.

verbose=level

Turns on verbose output, where higher values of level produce more output. If -v is also specified on the LILO command line, the level is incremented by one for each occurrence of -v. The maximum verbosity level is 5.

HOME PAGE


What is LILO's name and Description..??

HOME PAGE

NAME

lilo - install boot loader

SYNOPSIS

Main function:

/sbin/lilo - install boot loader

Auxiliary uses:

/sbin/lilo -q - query map
/sbin/lilo -R - set default command line for next reboot
/sbin/lilo -I - inquire path name of current kernel
/sbin/lilo {-u|-U} - uninstall lilo

DESCRIPTION

lilo installs a boot loader that will be activated next time you boot. It has lots of options.

-v

Increase verbosity. Giving one or more -v options will make lilo more verbose.

-q

List the currently mapped files. lilo maintains a file, by default /boot/map, containing the name and location of the kernel(s) to boot. This option will list the names therein.

-m map-file

Use specified map file instead of the default.

-C config-file

lilo reads its instructions about what files to map from its config file, by default /etc/lilo.conf. This option can be used to specify a non-default config file.

-d delay

If you have specified several kernels, and press Shift at boot-time, the boot loader will present you with a choice of which system to boot. After a timeout period the first kernel in the list is booted. This option specifies the timeout delay in deciseconds.

-D label

Use the kernel with the given label, instead of the first one in the list, as the default kernel to boot.

-r root-directory

Before doing anything else, do a chroot to the indicated directory. Used for repairing a setup from a boot floppy.

-t

Test only. Do not really write a new boot sector or map file. Use together with -v to find out what lilo is about to do.

-c

Enable map compaction. This will merge read requests from adjacent sectors. Speeds up the booting (especially from floppy).

-f disk-tab

Specify disk geometry parameter file. (The default is /etc/disktab.)

-i boot-sector

Specify a file to be used as the new boot sector. (The default is /boot/boot.b.)

-l

Generate linear sector addresses instead of sector/head/cylinder addresses.

-L

Generate 32-bit Logical Block Addresses instead of C:H:S addresses, allowing access to all partitions on disks greater than 8.4Gb.

-P {fix|ignore}

Fix (or ignore) `corrupt' partition tables, i.e., partition tables with linear and sector/head/cylinder addresses that do not correspond.

-s save-file

When lilo overwrites the boot sector, it preserves the old contents in a file, by default /boot/boot.NNNN where NNNN depends on the device. This option specifies an alternate save file for the boot sector. (Or, together with the -u option, specifies from where to restore the boot sector.)

-S save-file

Normally, lilo will not overwrite an existing save file. This options says that overwriting is allowed.

-u device-name

Uninstall lilo, by copying the saved boot sector back. A time-stamp is checked.

-U device-name

Idem, but do not check the time-stamp.

-R command line

This option sets the default command for the boot loader the next time it executes. The boot loader will then erase this line: this is a once-only command. It is typically used in reboot scripts, just before calling `shutdown -r'.

-I label

The label of the running kernel can be found in the environment variable BOOT_IMAGE after startup. This command will print the corresponding path name on stdout.

-V

Print version number.

The above command line options correspond to the key words in the config file indicated below.

-b bootdev

boot=bootdev

-c

Compact

-d dsec

delay=dsec

-D label

default=label

-i bootsector

install=bootsector

-f file

disktab=file

-l

Linear

-L

lba32

-m mapfile

map=mapfile

-P fix

fix-table

-P ignore

ignore-table

-s file

backup=file

-S file

force-backup=file

-v

verbose=level

HOME PAGE

What is Grub and how to configure it..??

HOME PAGE

GRUB

GRUB combines installations with one install command and allows for MD5 encryption of passwords. When a configuration file is configured incorrectly, the system reverts to the command-line prompts.

GRUB Configuration File

Given below is a sample /boot/grub/grub.conf file.

default=0
 
timeout=10
 
splashimage=(hd1,2)/grub/splash.xpm.gz
 
password --md5 [encrypted password]
 
title Linux
 
password --md5 [encrypted password]
 
root (hd1,2)
 
kernel /vmlinuz-2.6.23-13 ro root=LABEL=/
 
initrd /initrd-2.6.23-13.img
 
title Windows XP
 
password --md5 [encrypted password]
 
rootnoverify (hd0,0)
 
chainloader +1

The default = option tells GRUB which image to boot by default after the timeout period. The splashimage option specifies the location of the image for use as the background for the GRUB GUI. The password option specified the MD-5 password to gain access to GRUB's interactive boot options. To generate an md5 password, run the tool grub-md5-crypt as root. Copy this into your grub-conf password—md5. You can create separate passwords for each entry in the file. The initrd option specifies the file that will be loaded at boot time as the initial RAM disk.

The rootnoverify option tells GRUB to not try to vary the root of the OS. The chainloader+1 tells GRUB to use a chain loader to load Windows on the first partition of the first disk. It uses the blocklist notation to grab the first sector of the current partition with '+1'.

For other parameters refer to grub man pages.

Booting Fallback Systems

GRUB supports a fallback mechanism of booting one or more other entries if a default boot entry fails.

Suppose that you have three systems, "A," "B," and "C." "A" is a system that you want to boot by default. "B" is a backup system, which is supposed to boot safely. "C" is another backup system, which is used in cases where "B" is not working properly.

Let's suppose you want GRUB to boot the first system that is bootable among "A," "B," and "C." To do this, write configuration file like this:

default saved
 
timeout 10
 
fallback 1 2
 
title A
 
root (hd0,0)
 
kernel /kernel
 
savedefault fallback
 
title B
 
root (hd1,0)
 
kernel /kernel
 
savedefault fallback
 
title C
 
root (hd2,0)
 
kernel /kernel
 
savedefault

GRUB will boot a saved entry by default and save a fallback entry as next boot entry.

When GRUB tries to boot "A', GRUB saves "1' as next boot entry, because the fallback command

specifies that "1' is the first fallback entry. The entry "1' is "B', so GRUB will try to boot "B" at next boot time if "A" fails.

Likewise, when GRUB tries to boot "B," GRUB saves "2" as next boot entry, because fallback specifies "2" as next fallback entry. GRUB will boot "C" after booting "B."

You need to run grub-set-default when "A" starts correctly or you fix "A" after it crashes, since GRUB always sets next boot entry to a fallback entry. You should run this command in a startup script such as rc.local to boot "A" by default:

# grub-set-default 0

where "0" is the number of the boot entry for the system "A."

Troubleshooting

Let's suppose you installed GRUB, a third party boot manager program, on a Windows XP-based machine. When you try to start this computer after an unsuccessful upgrade to Windows Vista, the computer does not start. Instead, a black screen appears together with a blinking underscore. The Windows Vista Setup program does not restore GRUB.

To fix this problem, use the Windows XP Recovery Console to write a new boot sector to the system partition. To do this, follow these steps:

  1. Use the Windows XP CD to start the computer.
  2. At the Welcome to Setup screen, press R to repair Windows.
  3. Log on to the Windows XP installation that you want to repair.
  4. Type fixboot, and then press ENTER.
  5. Type y, and then press ENTER to confirm that you want to write a new boot sector to the system partition. When you do this, the following information appears:
    The new bootsector was successfully written.

HOME PAGE

Which Is Better GRUB or LILO..??

HOME PAGE


LILO is older and less powerful. Originally LILO did not include a GUI menu choice (but did provide a text user interface). To work with LILO an administrator has many tasks to perform in addition to editing the configuration files.

GRUB is a bit easier to administer because the GRUB loader is smart enough to locate the /boot/grub/grub.conf file when booting. An administrator only needs to install GRUB once, using the "grub-install" utility. Any changes made to grub.conf will be automatically used when the system is next booted. In contrast, any changes made to lilo.conf are not read at boot time. The MBR needs to be "refreshed."

Like GRUB does, LILO has no interactive command interface and does not support booting from a network. If LILO MBR is configured correctly, the LILO system becomes unbootable. If the GRUB configuration file is configured incorrectly, it will default to the GRUB command-line interface without risking of making the system unbootable.

LILO and GRUB allows users—the root users—to boot into single-user mode. Both have a password protection feature with a difference. While GRUB allows for MD5 encrypted passwords, LILO manages only text passwords, which anyone can read from the lilo.conf file with the command cat /etc/lilo.conf.

HOME PAGE


Define LILO Configuration File..??

HOME PAGE

LILO Configuration file

Given below is a sample /etc/lilo.conf file. You should follow the naming conventions like Linux (for kernel 2.6.23-13). You can have many kernel images on the same /boot system. Get the latest Linux kernel versions before you try out the configuration file.

For other parameters, refer to the manual pages (man lilo.conf).

boot=/dev/hda

map=/boot/map

install=/boot/boot.b

prompt

timeout=50

compact

default=Linux

image=/boot/vmlinuz-2.6.23-13

label=Linux

read-only

root=/dev/hdb3

password=Linux

image=/boot/vmlinuz-2.4.18-14

label=ker2418

read-only

root=/dev/hdb3

other = /dev/hda

label = WindowsXP

The boot = option tells LILO to install the boot loader to the MBR of the first hard disk. The map = and install = options point to the files that LILO uses internally during bootup. Do not change these files.

When booting, the boot loader will wait five seconds for you press Shift. If you don't, then Linux, the first kernel, will be booted. If you do, the boot loader will ask you which image to boot. If you forgot the possible choices, press TAB and you will be presented with a menu. You now have the choice of booting Linux, ker2418, or WindowsXP. After you make your selection, you will find the compact option speeds up the booting process. Loading Linux prompts you to enter a password for the image. You can add the fallback= option to any image. This option specifies that is stored as the default command line if the current image is booted. If using the fallback option, the next reboot will load a different kernel.

Since lilo.conf is not read at boot time, the MBR needs to be "refreshed" when it is changed. Like getting LILO into the MBR, you need to run:

$ /sbin/lilo –v -v



1. Troubleshooting

When you install Microsoft Windows on a computer that has the Linux operating system installed, Windows may overwrite or deactivate the Linux boot manager. As a result, you can no longer access the Linux operating system.

Here's how to fix the problem. If LILO was installed to the MBR, restart the computer using a bootable Linux floppy disk and then run LILOCONF program from the floppy drive. If LILO was installed to the superblock, use the FDISK command to activate the Linux partition.

Another possible solution is to delete the Linux partitions on a Windows-based computer, restart the computer, and then use Partition Magic to create Linux partitions. This utility comes with BootMagic, which allows you to switch operating systems.

To allow Linux system fixes, you can enter rescue at the boot prompt to boot Linux into single-user mode. Similar to rescue, you can also enter single to try to boot from your hard drive. You can also use root=to allow you to boot from a CD-ROM.


HOME PAGE

Difference between LILO vs. GRUB..??

HOME PAGE

In general, LILO works similarly to GRUB except for three major differences:

· It has no interactive command interface.

· It stores information about the location of the kernel or other operating system it is to load on the MBR.

· It can’t read ext2 partitions.

The first point means the command prompt for LILO is not interactive and only allows one command with arguments.

The last two points mean that if you change LILO's configuration file or install a new kernel, you must rewrite the Stage 1 LILO boot loader to the MBR by issuing the /sbin/lilo -v -v command. This is more risky than GRUB's method, because a misconfigured MBR leaves the system unbootable. With GRUB, if the configuration file is erroneously configured, it will simply default to its command line interface.

1. LILO and GRUB: Boot Loaders Made Simple

LILO (Linux Loader) and GRUB (GRand Unified Bootloader) are both configured as a primary boot loader (installed on the MBR) or secondary boot loader (installed onto a bootable partition). Both work with supporting operating systems such as Linux, FreeBSD, Net BSD, and OpenBSD. They can work with unsupported operating system, such as Microsoft Windows XP, in the configuration file. Both allow users—root users—to boot into single-user-mode.

2. LILO and GRUB: Boot Loaders Made Simple

LILO (Linux Loader) and GRUB (GRand Unified Bootloader) are both configured as a primary boot loader (installed on the MBR) or secondary boot loader (installed onto a bootable partition). Both work with supporting operating systems such as Linux, FreeBSD, Net BSD, and OpenBSD. They can work with unsupported operating system, such as Microsoft Windows XP, in the configuration file. Both allow users—root users—to boot into single-user-mode.

LILO

LILO comes as standard on all distributions of Linux. To work with LILO an administrator edits the file /etc/lilo.conf to set a default partition to boot, the time-out value, which choices should appear in a menu, kernel parameters, which partition to mount as the root partition, whether or not to initially load a RAM disk, where LILO should be installed, and other information. The administrator must then update the loader by running the LILO command.

  1. Type exit, and then press ENTER to exit the Recovery Console.
  2. Restart the computer, and then finish the Windows Vista upgrade operation.
  3. Reinstall the GRUB boot manager program.

HOME PAGE

What is LILO and the x86 Boot Process..??

HOME PAGE

This section will discuss in more detail the specific role LILO plays when booting an x86 system.

LILO loads itself into memory almost identically to GRUB, except it is only a two stage loader.

1. The Stage 1 or primary boot loader is read into memory by the BIOS from the MBR. The primary boot loader exists on less than 512 bytes of disk space within the MBR. The only thing it does is load the Stage 2 boot loader and pass to it disk geometry information.

2. The Stage 2 or secondary boot loader is read into memory. The secondary boot loader displays the Red Hat Linux initial screen. This screen allows you to select which operating system or Linux kernel to boot.

3. The Stage 2 boot loader reads the operating system or kernel and initrd into memory. Once LILO determines which operating system to start, it loads it into memory and hands control of the machine to that operating system.

Once the Stage 2 boot loader is in memory, LILO displays the initial Red Hat Linux screen with the different operating systems or kernels it has been configured to boot. If you only have Red Hat Linux installed and have not changed anything in LILO's configuration file, you will see only linux as an option. If you install SMP kernel support, you will see linux-up as an option. If you have set up LILO to boot other operating systems as well, this screen is your chance to select what operating system will boot. Use your arrow keys to highlight the operating system and press Enter.

If you would like to have a command prompt to enter a command to LILO, press “ctrl-x”. LILO displays a LILO: prompt on the screen and waits for input from the user.


HOME PAGE