How to setup boot loaders

From ThinkWiki
Revision as of 03:42, 23 August 2005 by Wyrfel (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page (hopefully) will explain everything you should know about the major bootloaders so that you can configure them to your liking.

LILO, GRUB and NT Boot Loader

Comparison Table
LILO GRUB NT Boot Loader
boot selector
  • line input
  • text menu
  • graphical menu
  • line input
  • text menu
  • text menu
OS support GNU/Linux FreeBSD, NetBSD, OpenBSD, GNU/Linux none
Windows Support via chain-loading via chain-loading WinNT, Win2K, WinXP
supported filesystems block offset based BSD FFS, FAT16, FAT32, Minix fs, ext2fs, ReiserFS, JFS, XFS, VSTa FAT16, FAT32, NTFS
Partition designation example
(second partion on first harddisk)
/dev/hda2 (hd0,1) multi(0)disk(0)rdisk(0)partition(2)

LILO

GRUB

NT Boot Loader

The Windows 2000/XP boot loader is a bit hard to tweak if you want something else than use it to choose between your Windows installations.

The NT Boot Loader generally works like this:

  • The booted partitions (i.e. the active one) boot sector looks for ntldr.exe on the active partitions filesystem. NTLDR is the actual boot loader and control is given to it if it's found. Else the boot process will fail.
  • NTLDR looks for the boot.ini file on the active partition to read it's configuration. If more than one operating systems are configured in the file and the delay parameter is not 0, then the NT boot menu is displayed.
  • When the user chooses a system, the delay time runs out or there is only one given system, NTLDR will start that system.

Using the NT Boot Loader to boot Linux

ToDo...

Using LILO or GRUB to boot Windows

When you want to configure a linux boot manager to boot Windows, there are some aspects to care about.

  • First of all, do not install LILO or GRUB to the Windows partitions boot sector. This would overwrite the Windows boot loader and Windows would not be bootable anymore. In fact it is always a good idea to install the linux bootloader to the MBR.
  • Take care that at least at the time of booting, your Windows partition is the active one. As long as the LILO/GRUB is installed to the MBR, the Linux boot process doesn't depend on the active partition flag. So in most cases you can just set it on the Windows partition (using i.e. # fdisk /dev/hda) and leave it. However, there are cases requiring a more dynamic handling. GRUBs makeactive command can help you here.

LILO configuration

Given that /dev/hda2 would be your Windows partition, a typical /etc/lilo.conf section for booting it with LILO would be:

other=/dev/hda2
label=win

GRUB configuration

Given that /dev/hda2 would be your Windows partition, a typical /boot/grub/menu.lst section for booting it with GRUB would be:

title Windows
rootnoverify (hd0,1)
makeactive
chainloader +1