Archived Page on Booting

How to boot - how to set up booting for more than one Operating System…

During installation there are options for how you want to boot your system. LILO or GRUB are usually offered as boot managers. You may be offered the possibility of making a boot floppy, although now that floppy drives are not necessarily a part of a computer's hardware, some distros do not offer this during the installation. A boot floppy used to be the standard way of booting during an emergency when one could not boot from the hard drive. Since modern computers can boot from CDROM, emergency booting can be done from the installation CD when no floppy drive is available.

There's a great description of the boot process for Linux called “The Linux Booting Process Unveiled” at http://www.pycs.net/lateral/stories/23.html - (not including Slackware which does it the BSD way). Also see From-PowerUp-To-Bash-Prompt-HOWTO at The Linux Documentation Project.

If this is your first install of Linux, you may be wanting to keep Windows installed on your computer and make a dual boot system with the option to boot either Windows or Linux. This page deals primarily with that scenario, although these boot managers are normally used for booting when Linux alone is installed.

Methods for Booting:

Note: What follows is rather detailed material on the various ways you can multi boot. Practically speaking, you will probably not need to be concerned about this when you install Linux. Installers will find other operating systems on your computer and create what is required to boot them. The installer will probably make the version of Linux that you are installing the default OS to boot, but you will have some sort of menu to select a different OS.

Floppy Disk:

Boot Windows by default. Use floppy disk to boot into Linux.

  • Here you simply make the boot floppy for Linux when you install and then put it in the floppy drive when you want to boot Linux. Otherwise Windows boots. You can make a LILO boot floppy (See below) which will boot a lot faster, because the kernel loads from the hard drive rather than from the boot floppy.

Loadlin:

Loadlin is a simple DOS based utility that loads the Linux kernel into memory from DOS. The Linux kernel and loadlin.exe are placed in a small directory under Windows. A couple of edits are made to config.sys and autoexec.bat in Windows and a small script is written to start Loadlin. You can find loadlin.exe and instructions on your install CDROM. Loadlin works with versions of Windows through Windows 98, but may not work with Windows XP installed, as it usually is, on NTFS.

Boot Manager:

Install a boot manager which will give you the choice to boot either Windows or Linux. Two of these commonly found in Linux distributions are LILO and GRUB

LILO

  • Configuration for LILO is done in /etc/lilo.conf. Example:

boot=/dev/hda

         vga=normal
         prompt
         timeout=100
         image=/boot/vmlinuz-2.4.20
           label=Linux
           read-only
           root=/dev/hdb2
         other=/dev/hda1
           label=windows
           table=/dev/hda
  • If you make a change to /etc/lilo.conf, you must run /sbin/lilo to write it to the MBR.
  • To remove LILO from the MBR and replace what was there originally do:
    /sbin/lilo -u

GRUB, the GRand Unified Bootloader

  • If you have not already had it installed in the MBR during the installation of Linux, it might be best to try installing it on a floppy disk. This will prevent overwriting the MBR if you already have LILO installed there. To install to the MBR substitute /dev/hda for /dev/fd0. The steps are:
  • Install the grub package using your package manager
    • Put a floppy in the drive. It doesn't matter if you mount the floppy or not at this point.
    • The following command makes the directory /boot/grub and writes GRUB to the floppy boot sector.:
      # grub-install /dev/fd0
    • The following command will analyze your hard drive and create /boot/grub/menu.lst. Note: Depending on your distribution, the file may be found in /boot/boot/grub and it may be named grub.conf:
      # update-grub
    • Edit menu.lst (grub.conf) if needed. Look to see if update-grub found the partitions correctly.
      • Here is the part you need to look at:
         default    0
         title           Debian GNU/Linux, kernel 2.4.20 
         root            (hd0,0)
         kernel          /vmlinuz-2.4.20 root=/dev/hdb2 ro
         savedefault
         boot
         title           Debian GNU/Linux, kernel 2.2.20-idepci
         root            (hd0,0)
         kernel          /vmlinuz-2.2.20-idepci root=/dev/hda3 ro
         savedefault
         boot
         title         Windows 95/98/NT/2000
         root          (hd0,0)
         makeactive
         chainloader   +1
  • The above is set to boot Windows and two installs of Debian on one hard drive.
    • In the first line: 'default 0' means the first title described will boot by default. Setting it to '2' would cause the third title, Windows, to boot by default.
    • In the second line 'title' is a description that was automatically given by update-grub.
    • In the next line 'root' is not the / partition but is the location of the kernel in /boot. In this case /boot is a separate partition where both of these kernels reside. update-grub initially had put (hd1,1) in menu.lst which was wrong. /boot was actually on /dev/hda1 or (hd0,0) You will need to make sure it is correct for your system.
  • This is a good time to look at the nomenclature GRUB uses for partitions.
    • hd stands hard drive. The number after it indicates which drive where 0 is the first, just as a is the first in the usual Linux drive nomenclature. The second number indicates the partition. The first partition is 0 instead of 1 like we have learned for Linux.
    • The next line talks about the kernel. First we have its name. It is found in /boot and the name begins with a /, because until that kernel is found, root (/) really is /boot. When the kernel is found and booted, then it is going to want to know where the root for your system is supposed to be. You tell it on that same line and you tell it in Linux nomenclature, because the one in charge now is Linux. GRUB has done it's job. As you can see above, there are two different kernels and two different root partitions. I did not have to edit this line.
  • Copy menu.lst to the floppy:

mount -t ext2 /dev/fd0 /mnt

         cd /boot/grub
         cp menu.lst /mnt
         umount /mnt
  • Leave the floppy in and reboot. If bad things happen and it doesn't boot, just remove the floppy and boot in whatever way you did before. You have not destroyed your MBR. By the way, you can install LILO on a floppy in a similar way by editing /etc/lilo.conf and replacing /dev/hdx (where x is a if you are using the first hard drive) with /dev/fd0 in the line which has: boot=
GRUB Command Line

Sometimes you have a broken boot and need to use GRUB from its command line to boot. You may have a GRUB boot floppy or GRUB installed in the MBR. You can investigate the system and boot using GRUB. See GRUB Command Line.

More on GRUB

GRUB is a powerful bootloader, which has advanced features. Many people trying to install or repair GRUB, or boot with a new kernel, run into booting problem, which could be alleviated would they know about hiding partitions, using fallback, or how reinstall/repair the bootloader.

It is also generally believed that GRUB does not allow you to choose your next booted OS before reboot (as LILO does). But in fact, it can be done.

/home/www/LinuxBasics.org/data/pages/historical/old_booting_page.txt · Last modified: 2008/07/20 21:08 (external edit)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0