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.
Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.
Linux® is a registered trademark of Linus Torvalds.
Welcome to LinuxBasics.org - The online community that helps people to get Linux installed and running.
During this tour, we will guide you through our website, which has many facets which wait to be explored
The biggest project we are running is our Linux course, based on the LBook.
The book is stored in wiki-format, which enables us to update and correct it as we go.
Discussion for the course is on our Forum
Our Forum is used for discussion of Linux and for questions and answers.
Search the mailing-list that was used prior to the Forum.
The questions and answers from the list are stored in the list's archives in order to help others with the same problems.
Every weekend, we meet to chat in IRC. These meetings are NOT mandatory, but are a nice chance to get to know each other better.
IRC is also a great tool to solve many problems, since it is very quick and easy to ask for more details if you need them.
The tutorials are one of the oldest sections on the LBo-website.
Here you find explanations on how to do specific tasks in Linux. Many of the tutorials were created after a certain problem
has been discussed (and usually solved :) on the mailing-list.
The tutorials are categorized in
In the links section, you find outbound links to other valuable resources.
One of our later additions to the site. We maintain a mirror of the Linux Documentation Project. This is our contribution to the "home of the HOWTOs"
Another later addition is the LBlog which focuses on how to do stuff on the Linux Desktop. It begins with the basics on installing Ubuntu.
Using the integrated site-search, you can search the tutorials, the LBook and all other wiki-pages
Simply type the search term into the box in the upper-right corner of our webpages
As a community, we depend on your feedback and collaboration. So, if you have something to share with others, please contact us. If you have a suggestion for a topic you would like to see covered here, please add it on the Wishlist.
There are many ways to contribute: You can answer questions on the Forum, you can write a complete tutorial or just a step-by-step documentation on how you completed a specific task using linux. Ask questions if the information on this site is not clear, tell us if we got something wrong, spell-check our writings, whatever.
We are looking forward to meeting you at LinuxBasics.org
Anita, Jisao, Sam and Stefan