The Linux Guide Online

Chapter 02 - Installing Linux

This section makes the assumptions that the average newcomer to Linux:

  • has a computer with MS-DOS and Windows or OS/2;
  • has a basic understanding of MS-DOS but not UNIX;
  • knows or can find out what kind of hardware the computer has installed;
  • has a desire to "try out" Linux for whatever reason, though probably not switch to it exclusively (yet); and
  • has neither a spare machine nor second disk drive available, but several hundred megabytes on an existing drive free for use.

These assumptions are not extreme, and may even be a bit conservative. If you are installing Linux for a dedicated system, then many of the concerns here may not bother you at all. You may skip the sections that describe resizing and partitioning your existing hard disk without losing space.

2.1. Various distributions of Linux

2.1.1 SuSe, Caldera, Slackware, Debian, Mandrake

Linux has a number of distributions or packages that help in simplifying the installation and maintenance of the system. The distribution also decides the software that accompanies that particular distribution. These distributions are: Debian, Red Hat, Caldera, Slackware, and S.u.S.E. But remember, Linux is the kernel. The software is part of the distribution, not Linux. Most of the software is freely available and can be ported between various UNIX platforms. After taking into account what the kernel itself will support, the biggest difference comes in what the libraries (software called from within the applications) support.

Each distribution has its own installation and maintenance utilities that ease installation and system administration. Each is apparently aimed at a different audience. Any distribution will get you started and keep you running. So we recommend that you read about each distribution and talk to any knowledgeable friends. Most large cities have a Linux User Group , most with experienced users, who argue at length over which distribution is the best, and why. We suggest that you listen to some of their arguments and then decide. You can also join mailing lists (only one at a time) and reading user posts and answers from the list gurus. As different as each distribution is, so too are the mailing lists that provide assistance. Making the right choice for yourself is important, because changing distributions generally means reinstalling from scratch.

2.1.2 Red Hat

The most famous of these distributions is Red Hat, known for its ease if use and it's first time user-friendly installation procedures. ( CNet has actually voted RedHat 7.1 as the best distribution for newbies) This company has the support of many commercial firms (like Intel, IBM) behind it. As of today Red Hat has arguably the best and most user-friendly installation packages (known as the Red Hat Packet Manager - RPM). Hence this book will mainly deal with the installation, as done using Red Hat.

Finally we would like to say that overall there is not much to choose from between the various distributions. Actually it is more of a preference and availability.

2.2 Installing Linux (Red Hat version 6.2, but applicable to higher versions as well)

This section explains all of the installation steps necessary short of the actual install. Each distribution handles this preparation slightly differently. While the installs look different, they accomplish the same things and have more in common than not. All require:

  • planning;
  • gathering system hardware information;
  • backing up your old system (optional, but strongly recommended);
  • preparing Linux partitions;
  • deciding on a boot loader (for dual boot systems);
  • booting a Linux kernel;
  • installing the kernel;
  • choosing and installing software packages;
  • loading the software;
  • making final configuration adjustments; and
  • rebooting into a running system.

Now that We've sufficiently oversimplified the process, let's go down the list. We shall look at the above list not in its strict chronological order but we shall also learn a bit about the system and why linux has to be installed the way it is done. Hang on, it's not that bad when you learn from others' mistakes.

2.2.1 About Partitions

About the hard drive and its partitions

Nowadays hard disks come in a variety of sizes. As the size of the hard disk increases it will be difficult to maintain it. Also the operating system too suffers in performance. In fact the first bootable partition in Windows (what is generally referred to as the C: ) cannot be more than 8 GB in size. These restrictions are the reason you will want to partition your hard drive. Partitioning allows you to see the same harddrive as multiple drives, with the space of the drive distributed among them.

Partitioning a drive is accomplished with the help of tools such as the fdisk (that is part of MS-DOS), fips or third party tools like the Partition Magic. The process of partition meddles with the partition tables of the drive. These are very sensitive areas and any wrong tampering with them can render you system unusable. So take utmost care while changing the partition table of any drive.

Partitions are of certain types - primary or logical. Initially, when drives were first introduced, the maximum number of partitions was restricted to four. So all subsequent drives too came in with the same limitation. Nowadays, however, it is possible to partition the drive into as many partitions as is required. This is accomplished by using what are known as extended and secondary partitions. To put it simply one of the partition that is created as the primary partition is converted to act as an extended partition. This then acts as a place holder for all the other drives that are to be created as logical partition. All the logical partitions are created by breaking up this extended partition into the required number of pieces.

Partitioning is a device dependant feature. That is partitions are detected by the hardware itself. However the type of partition is what the OS is interested in. The type is determined by the kind of file system that resides in the particular partition (primary or logical). Note that the extended partition does not have any file system in it.

Linux requires atleast two partitions for itself before any installation can be attempted. The first is the main linux partition that will hold the default '/' root directory, and an additional partition called the swap partition that is mandatory in Linux.

Partitions on your system

At the beginning of this chapter we made a few assumptions. One was that you would want to keep your comfortable MS-DOS and Microsoft Windows operating system around. And since the computer you bought only has MS-DOS on it, it doesn't make sense to have multiple partitions, so the one drive you have is probably entirely dedicated to MS-DOS.

One way or another, then, we will have two operating systems on this computer. If you currently have nothing on your disk (lucky you), that is great, but you're not quite ready to skip ahead. Linux is comfortable wherever you put it. Your BIOS may not be capable of booting it, but once running, it will not complain if it's relegated to the fourth partition of the fourth hard drive. But MS-DOS and Microsoft Windows aren't so forgiving. They want the first drive and the first partition and may refuse to boot from any other position. We have seen MS-DOS boot from the first partition on the second hard drive, but the first hard drive did not have any MS-DOS partitions, so MS-DOS didn't recognize the drive. The best strategy is often the path of least resistance. If at all possible, put MS-DOS on the first drive and the first partition.

A second consideration in a multiple OS situation is which operating system to load first. If you're tempted to partition the hard disk and install Linux first (reserving /dev/hda1 for MS-DOS, then installing MS-DOS second, don't. Windows 95 is the worst offender, but Microsoft products in general will delete any previous boot loader you had installed on the master boot record (what the BIOS uses to point to bootable kernels). In fact, you may even hear this referred to as the ``Microsoft virus''. This is not a virus in the true sense of the word, just arrogance on the part of Microsoft, that one would only want a Microsoft operating system to boot. Linux does not cause such problems, and in fact provides a way to choose the default boot image. It also allows you to intervene during the boot process to specify which operating system to boot. This is a standard part of Linux installation procedures.

Now therefore the work is to repartition your existing drive into the required number of partitions so as to have both Linux and Windows running on the same machine together. Using a tool like the fdisk that is provided, it is possible to do the same. But fdisk requires all partitions to be reformatted. And also it can not resize existing partitions. Unless you want to reinstall both linux and windows on you system, do not try to do the repartitioning with fdisk.

Backing up your old system.

Before we actually get to work on the partition table, I will walk through procedures to protect the data that you have on the hard disk. These procedures assume that you have a DOS partition. Other operating systems may or may not have a way to accomplish the same thing.

The first thing that you should do is perform a complete backup. The tools that you will use work as they should. But these procedures are inherently dangerous. Any time you work with a hard disk partition table, you can easily lose all the data contained on the drive. Back up your hard disk before you proceed. Once you have your disk backed up, create a boot floppy disk for the system. You can either use the MS-DOS command

C:> format a: /s

which formats the floppy and puts the required system files on it, or, using a formatted disk, issue the command

C:> sys a:

Once you have created a boot floppy and tested it to insure that it works, copy the following files from your MS-DOS system to the boot floppy: FDISK.EXE, SCANDISK.EXE, and SYS.COM. Also copy the file RESTORRB.EXE from a Linux distribution CD or Linux FTP archive.

Run a defragmentation program on your DOS drive to defragment and group the files together at the front of the disk. If defragmeter encounters any errors, you need to run SCANDISK.EXE to fix the problems. Once you have defragmented the disk and ensured that the files are compressed toward the front of the drive (as indicated in the graphical portrayal of your disk), you're ready to run FIPS.EXE to shrink the MS-DOS partition.

FIPS.EXE to the rescue

On your Linux distribution CD (or an Internet distribution site), you'll find a copy of FIPS.EXE, which can shrink the MS-DOS partition. Note that FIPS.EXE only works for MS-DOS partitions. If you have other partitions that you need to shrink, the program Partition Magic may help, but is not free. Copy FIPS.EXE to your boot floppy and reboot using this floppy. This accomplishes two things: it insures that the boot floppy works, and insures that you are booted into MS-DOS Real Mode and are not running Microsoft Windows.

At the A:> prompt, type FIPS (upper or lower case). You will be greeted and asked which drive you want to operate on (if you have more than one). Select the drive to shrink. Once you confirm your choice, let FIPS.EXE make a copy of your boot and root sectors to the floppy in case something untoward happens.

You will then be asked if all of the free space on your partition should be used to create a second partition. If you say, ``yes,'' you will not have any free space on the MS-DOS partition to save data to, so say, ``no.'' You will then be able to alter the amount of space allocated between the first and second partitions. Note that if you didn't properly defragment your drive, you won't have much to work with on the second partition. Also, if you use MS-DOS mirroring software, a file is created at the very end of the partition, and FIPS.EXE tells you that you have no space to create a second partition. Exit and correct the problem by deleting the MIRROR.FIL file, then restart FIPS.EXE.

You can edit and re-edit the table until you are satisfied. Once you are happy with the distribution of space between the partitions, confirm your changes and write out the table. There is an additional complication the will arise if you are using one of the more modern high capacity disks. Due to a bug in LILO (the boot loader for Linux) it cannot access the kernel if it is beyond the 8GB limit. So make sure that your Linux partition lies within this limit. (This problem has been overcome in the distribution of RH 7 and above)

Once FIPS.EXE has finished, remove the boot floppy and reboot your computer. In this example, we'll destroy and recreate the second partition during installation to create at least two partitions for Linux: a swap partition and a Linux native partition. But you can create as many as you like.

As already stated you can use a third party tool like the Partition Magic that can do the same in a graphical interface with minimum user intervention. But be sure to buy a copy of Partition Magic to do this. An word of caution. If the initial partition was done using fdisk, it is possible that the partition table might have errors on it. It is an accepted fact that fdisk does not write the complete partitioning information correctly. If such problems to surface during the above process then there is little any program can do. (Though partition magic does claim to be able to fix some of these errors)

Before we finish this discussion on partitions it is advisable to look at the way partitions are required under Linux that will allow you to plan the partitioning of you hard disk better.

The following system is created under Linux as a minimum during install. Other too might be formed or may be added (during or after installation) but this is the minimum you can expect to find. Also note that it is not necessary to have individual partitions for all of them. The root '/' is mandatory and unless specified otherwise all partitions are created under root automatically. If for example you create a root partition alone with a size of say 1000MB then all other Linux partitions now are created automatically. But if you specify 500MB for the '/usr' and 500MB for the '/' partition then '/usr will be fixed to 500MB with all other partitions accounting for the other 500MB of the root '/' partition.

The following table is for your reference and to add up values. You exact partitioning should conform to your requirements

Partition Size Comments
Swap 16 to 128MB This depends entirely on the amount of RAM on the system and the kind of usage expected. A general thumb of rule is at least 16MB, and about 2 times the RAM for small RAM values dropping to the size of RAM at say 128MB
/ 50-100MB Contains all required boot files and other required partitions. Make sure you read the above notes to actually determine its size.
/usr 300-700MB The most important partition and it contains all the files required by the system
/home Variable Depends on the number of users of the system times the size allocated to each one of them
/tmp 10-20MB Temporary files
/var Variable Directly depends on the number of users
/opt 200MB Third Party packages are stored here.
/boot 7-8MB The boot files. Allocate more of you want to compile kernels everyday for fun.

2.2.2 Installation checklist

This is perhaps the most important step that will make or break a Linux installation. To put it simply get information on all the hardware on your system. The following will help you decide what information is necessary. Windows may come handy at this point. Open the Settings/Control Panel /System and check out the properties of the various hardware under the Device Manager tab. Be as precise as possible, but don't get carried away. For example, if you have an Ethernet card, you need to know what kind (e.g., SMC-Ultra, 3Com 3C509, etc.), base I/O (e.g., io=0x300), interrupt (IRQ 10), but not the hardware address (00 00 a6 27 bf 3c). Not all information will be needed for your hardware.

Hardware Required Information (This is not exhaustive)
General  
Keyboard Normally common, Mostly we use the US layout. (check if your keyboard is basically different.
Mouse Get the make, port-type (serial, PS/2 or bus), if serial then the com port connected to
Hard disk Type: IDE/MFM/RLL/ESDI SCSI, the list of partitions on the various drives (use the print table feature of fdisk), and the layout of the drives.
CD ROM Type: IDE/ATAPI/SCSI, the make and the model number
RAM Amount
Processor Make, type and speed (along with information on the mother board installed)
X-Windows  
Monitor Check the brand, size, horizontal and vertical frequencies
Video Card Manufacturer and the model along with the amount of V-RAM
Sound Card Along with the make and model, knowing the I/O address, IRQ and DMA values will help.
Networking  
Network Card Make and the model
If connected to a network IP address, netmask, broadcast address, gateways, DNS addresses and the host name
Modem Make and model
Others  
Printers For all printers you will want the model and the make number etc. For networked printers you will want the type of connection and the spool etc.

2.2.3 Installation using Red Hat Linux

OK now you are ready to install Red Hat Linux on you system. Before you go ahead and look at the installation screen you must do the following.

Creating a bootable Installation disk

In order to install Linux, we must begin by booting the Linux kernel. This is accomplished in exactly the same manner as if you wanted to reload MS-DOS: we need a boot disk. You will most probably have a bootable CD-ROM from Red Hat linux. In this case you may skip this process and prepare to boot from the CD-ROM. But we'll go through the process of creating a boot disk for the rest of us.

Change to the CD-ROM drive under MS-DOS and go to the /images directory. Run the rawrite

D:\images> rawrite diskimage drive

The <drive> will be something like A: . This will create the required boot disks for you. (For those under another Linux system, the dd command should help you here. More information about making boot diskettes is given later.)

Set the boot sequence

Reboot the computer and press the [del] key during POST. This will bring up the BIOS setup. The BIOS is what readies your computer for booting. The boot sequence determines the order in which the various drives are checked for the existence of a bootable OS. Since you are probably using you computer normally the first option must have been set to the Hard disk (Primary). Follow any online help and change the order to check for your bootable media first (either your bootable CD-ROM or the floppy that you created earlier) save the changes and reboot.

Install Linux

If the above steps were successful you will shortly see a Linux kernel booting. This is what is going to boot your computer so that the installation can be done. After a short delay, a screen with a boot: prompt will show up. Here (if you are using Red Hat 6.2 and above) you will have the option of booting into a text mode installation or a graphical interface. Note that there is not much difference between the two except for probably the mouse. Also if you are installing a previous version you may not have this option. We will, for the sake of backward compatibility and circumventing additional problems that may crop up with a graphical interface, stick to the text mode (The use of the graphical interface has given us problems during install including random failure of the installation process. And further not all the information that is normally available to you in the other terminals is available to you if you work in the graphical screen, though if you have to switch to a terminal to see it, one would rather do the installation in the text mode). Type 'text' at the prompt and hit enter to start installing in the text mode. (A normal enter will suffice if the installation is an old one). We will now list the various steps below. Note that each step is marked with a different background.

Start

A screenfull of information will flash past as the kernel continues to boot, displaying the various hardware detected on your machine. There are a few tips here that will be handy during the entire installation. The tab and the arrow keys will be used for navigation during the installation. Press the space to select/deselect and enter to confirm or 'click' a button. Escape normally selects cancel. Also there will be available a number of virtual screens, that will be activated during install. There can be accessed by using the alt key along with a function key. Alt+F1 brings is the default installation screen. Alt+F2 is a shell prompt, Alt+F3 is the install log and Alt+F4 is the system log that logs messages from the kernel etc.

Language, keyboard and installation media

You will be led through screen that will ask you the language. Select English. Select the US keyboard unless you specifically know that your keyboard type is different. Then select the installation media as the CD-ROM.

Installation type

You will then be asked if the present operation is an installation or and upgradation. Since this is you first time you will choose installation. We will not deal with upgradation here but this will be a very useful option once you have a Linux machine running and reinstallation will lose valuable data. The next step is to decide the kind of installation you require. You will have three options to choose from - Workstation, Server and the Custom class. The first two are for special installation that automate certain processes and give you easier installation after sacrificing some flexibility. The third is the most flexible option where you will have control over all aspects of the installation.

The Workstation-Class installation
You should choose a workstation class installation if you are still learning the ropes of Linux and have never installed it, or if you do not want to involve yourself in the installation. This is much like a 'Standard installation' option for windows installation. The installation program itself will handle all the different settings such as the mount point and the size of the partitions. This installation requires approximately 600 MB of disk space. Choose this installation if you want a relatively simple, easy and problem-free installation of Linux.

The Server-Class installation
Choose the server class type of installation if you intend to use you computer as a server. As in the workstation-class installation, the settings are predefined and are customized to be a server-type computer.
Caution: You cannot use this kind of installation in a dual-boot machine. You cannot use this method if you want to retain a Windows installation that is already existing on the computer. This is because ALL the partitions on the machine will be formatted and replaced with ones to suit Linux. All data previously on the computer will be lost.

The Custom-Class installation
In this method you have complete control over all aspects of the installation. You can not only control the number, types and sizes of partitions but also the various packages that you want to be installed on your computer. Pay proper attention to master even this class of installation, which is reputed to be difficult.

SCSI

Then you will be asked if you have any SCSI controllers on the machine. If you do, answer in the affirmative and select the driver for your card from the list that comes up. If you card is not listed look up the documentation of your card to find an alternate driver that is closest to the one you have. You may also have to manually configure it if you cannot use any of the listed drivers.

At this point the Workstation and the Server class installation will jump ahead and we will continue with the Custom-Class.

Disk Druid

This is a very useful and transparent tool that allows you to set the partitions for the installation of Linux. This is provided in addition to the standard tool, fdisk that is more cryptic and difficult to use. Using disk druid is easy and is followed here. If you are comfortable in using fdisk, do so to accomplish the same task as below.

Using Disk Druid you can now delete, add and remove partitions. If you are installing on a system that was already in use with Windows, you will have created a new partition for installing Linux. You will have to delete either this one or one or more of the existing partitions to get new space that you can now use for Linux. Delete the identified partitions to get free disk space (that is listed on the screen)

Beware: You must be very careful in choosing the partition for deleting, all information and indeed all of the drive will now no longer be accessible from Windows. Hence double check before deleting any of the existing partitions. One way of keeping track of the partitions is the order and the sizes of the drives. (For example: if you are deleting the d: then it will most probably be the second partition of the first drive of a single hard disk machine)

Now you have to add the necessary partitions. Linux need at least two partitions - the Linux native and the Linux swap. (You may create additional partitions if you created space for it using the table given earlier) Use the "add" button to add the partitions. Select the type of partitions - Linux Swap for the swap and Linux Native for the '/' or the '/usr' etc as the case may be. In the least add the space decided for the swap and the rest of the space for the root partition.

Note here that the space allocated is not strictly according to your requirement. It is done taking into account the sectors and the tracks. The options of "growable" will be very helpful in this allocation. You may also choose different drives in the allowable drives radio. The various drives are referred to as the hd's. The primary master is hda, The primary slave hdb, Secondary master hdc and the Secondary slave hdd. (If you are using SCSI drives then your drives will be sda, sdb etc.)

Create the required number of partitions as you want to in the free space. Then select "ok". A message will pop up asking if you want to write the partitions to disk. All that you have done till now is reversible. Check if you allocation is correct and select ok. The table will be accepted (and will actually be written later during the installation). You may also set the mount points here for your windows drives so that you will be able to access them automatically under Linux.This is not mandatory and you may do so later too by editing the fstab file. Set the mount points here to reflect your actual drive names. Note that all mount points must begin with a '/'. For example you may mount the c: under /c, d: under /d etc.

Initialize the drives

Here is where the other installations join in. The installation program will now prompt you to initialize the swap partition. Upon selection the swap will be ready to be formatted. Then you will be provided a list of partitions that you have created and you may choose to select the ones to format. The online prompt here will be very useful. Select the "check for bad block during format" if you have been experiencing problems with your hard disk or if it is old. Newer ones will not need to be tested and you may complete the format faster by not selecting it.

Select the packages

Now you are selected with a list of packages that can be installed. You can select and deselect partitions as required. Packages are a group of programs grouped together. If you would rather install individual components rather than the package, then check "Select individual packages". (Do not go for this unless you have an understanding of the various components and their dependencies) To get more information on a particular component hit the F1 key. If you want all the packages to be installed, you have an option that you may select. This requires in excess of 1.2GB of disk space. If you are not familiar with the selections to make then you may leave the defaults unchanged.

Select OK. You have now decided the system software configuration. What remains is to configure the system according to the hardware and make provisions to boot into your newly installed Linux.

Installation

You will be presented with a window informing you of the creation of a log file of the installation. The install starts in earnest as the program formats all the partitions you had specified earlier. (This might take long if you have a very large drive or if you had selected the "check for bad blocks" option.) After the partition initialization the packages will be deployed where you will be notified as the packages are being installed. This may take anything between 25 minutes to well over an hour depending on the speed of your machine and the number of packages you are installing.

Configure hardware and other Services

After the packages have been installed you will configure the hardware on your system so that the necessary drivers and files are updated as necessary.

Mouse:
Your system will be automatically probed for a mouse. Many of the standard mice are automatically detected and configured. You can even configure a two-button mouse to behave as a three-button mouse, where the simultaneous clicking of the left and the right buttons will be interpreted as the middle click. If your mouse is not listed select the one closest to your own or select a generic Microsoft mouse. If your mouse is serial, you will be prompted for the port next. Use the checklist you prepared earlier to supply this information.

Network:
The next window asks you if you want to configure a network. If you do not want to then skip this part. If you answer in the affirmative, then the program will try to probe for the network card that you have. If it fails you may have to do so or choose a close alternative. Enter all the details of the network from the preparation sheet. Do not select the DHCP option if the machine is to act as a server. DHCP works fine for a workstation.
Be warned that the installation of some versions may hang unceremoniously if you attempt to configure the network without actually being connected to one.

Time:
Set up the clock to reflect the local time. For India this is "Asia/Calcutta".

Services:
If you are doing a custom installation you will now have the option of selecting the various services (daemons) that start at boot time. Select them as required. Press F1 to know more about these services. If you are not sure of them then leave the defaults unchanged.

Printer:
If you opt to configure the printer, you can configure it to be a local or a networked printer. Select "local" if the printer is connected to your machine and not connected to any LAN. If the printer is connected to the LAN and is capable of communicating via lpr/lpd, select the "LAN Manager". Specify the spool and queue directory. For networked printers you will want to ensure that the network is working first. And you will also have included the information about the spool and printer type in the preparation sheet.

If your printer is connected to the same machine then you will have to specify the port, which it is connected to. Or you will have to specify the network information for the networked printer. Select the printer type and give details as to the paper size and resolution of the printer. You wont need to check the "Fix Stair setting of text" option. Confirm all the information and select OK to complete the configuration.

Password:
This is the most important password of the system. It is for the root account, which is the all-powerful account that can do almost anything to the system. It must be therefore difficult to guess. It must at least be six characters long and is case sensitive. (Check the state of the CAPS LOCK). Select the options to enable shadow and MD5 encryption. This will prevent some kinds of malicious interferences and will also make cracking all the more tedious. Only if you have a NIS server running and have all the relevant information, leave the default as it is.

LILO:
See the sections 2.2.4 and 2.3 for detailed information regarding this. Here it will suffice to create a boot disk (strongly recommended), and write LILO to the system MBR. Follow the online tips. Leave most of the options default. Label all the partitions and select your default partition (use F2).

X Windows:
The program will then conduct a PCI probe for the video cards. If the card is automatically detected and configured, then you may not have to do anything. (It is also good because the setting up of unknown cards is not easy under Linux).

Select your monitor from the list provided. Again if you do not find the correct name a close name may suffice. Alternately you may configure it manually, choosing the custom monitor. Specify the monitor's horizontal and vertical sync ranges.

X-Windows setup then tries to detect the video card. If not successful you will select the appropriate card or the "unlisted" card. For the unlisted card specify the chipset and the video RAM. Select the correct clock chip or "No clock chip" because normally they are selected. If it has not been selected then the most probable reason might be the fact that you do not have one. You may now save the settings and start the Xserver. If it is successful - congratulations. Otherwise recheck the configuration. You may also want to skip this setup and complete installation. The X configuration can be done directly from Linux too.

Reboot

That is it. Reboot. At the LILO prompt that comes up type "Linux" or whatever is the label you gave your Linux partition. You will see the Linux boot up and see the "login:" prompt. Congratulations: you have successfully installed Red Hat Linux on your system. Login as "root" (for now) and feel a completely new environment waiting just for you.

2.2.4 Boot and Rescue floppies

In this section we will talk of the various floppies that you may use for the purpose of booting and trouble-shooting Linux. The default option of booting through LILO is covered in the next section (2.3).

Installation boot diskette

You have already seen the method to prepare the installation diskette using Windows. It is reproduced here for the purpose of completeness. Note that the use of this diskette is complete once the installation is successfully complete. For the purpose of installation you will need two kinds of installation disks - the startup and the supplemental installation disks.

Creating a bootable Installation disk - Windows

Change to the CD-ROM drive under MS-DOS, containing the Red Hat installation. Go to the /images directory. Run the rawrite

D:\images> rawrite

The program will ask for the file name of the disk image. Enter boot.img. Insert a floppy into drive a. When prompted for the destination drive type a:. Run rawrite again and create another floppy with the image supp.img. Label the disks as "boot disk" and "supplemental disk".

Creating a bootable Installation disk - Linux

To create disks under Linux you can use the dd utility. Mount the Red Hat CD-ROM and change into the images directory. Insert a floppy into the drive (do not mount it). Use the following commands with two disks.

$ dd if=boot.img of=/dev/fd0 bs=1440k

To create the boot disk.

$ dd if=supp.img of=/dev/fd0 bs=1440k

To create the supplemental disk disk.

Creating Boot floppies to boot into the installed Linux system.

Normally you will use LILO to boot into a Linux installation. LInux LOader or LILO is a boot manager. It will be the first program that will run on the system, which will then allow you to choose the OS to run. But in some cases it might not be possible to use LILO. If you have not installed a root partition that begins and ends between cylinder 0-1023, Do not install LILO. When you reboot the system for the first time,(after installing Linux or LILO) if LILO does not allow you to boot your system correctly, use the Emergency MS-DOS and Windows 95 boot diskette and, at A:\> enter FDISK /mbr. This allows your system to boot into an existing MS-DOS or Windows 95 system as it did before LILO was installed.

Also if you upgraded your Windows, or installed another OS, then too the MBR may be overwritten and you might not be able to access your Linux partition. So it is always a good option to keep a boot and rescue floppy set handy.

Making a boot disk

You can create a boot disk in your newly installed Linux. Before making the disk check the kernel number of your installation. (You may do this for example by looking at the prompt above the login prompt). Assuming that it is 2.0.34-1 the following command will create the disk

$ mkbootdisk -device /dev/fd0 2.0.34-1

Insert a blank floppy and hit enter. Your boot disk is ready.

Rescue in Red Hat Linux

There may be a number of reasons your Linux may not boot. You may have problems if your LILO doesn't run or even if you have a kernel with the wrong root device. Making these disks will will prove invaluable in correcting these problems later. Also we will assume that these disks were already prepared when we describe the process involved in rescuing your Red Hat installation. You will have to create the boot disk as shown above. Then create the rescue disk by dumping the rescue image onto the floppy.

Mount and use the dd command as shown

$ mount /mnt/cdrom
$ dd if=/mnt/cdrom/images/rescue.img of=/dev/fd0 bs=1440k

Label the disk as "rescue". Booting through the main disk and typing rescue at the boot: prompt will allow you to attempt a rescue of your Linux system.

2.3 LILO

Booting Linux requires you to install a program to load the kernel into your computer. LILO can be used to start the computer from

  • The Master Boot Record MBR (The normal option)
  • The superblock of your root Linux partition on your hard drive
  • A floppy disk

LILO is found under the /sbin directory of your Red Hat system. There is also documentation for the program under /usr/doc. Along with the documentation here you will also find a script called QuickInst, which can be used to replace an existing LILO installation or for a first time install. Definitely check the Almesberger's README under the /usr/doc/lilo directory.

LILO can be changed in two simple steps
1. Configure the file lilo.conf
2. Run /sbin/lilo to update the settings

There are some problems that are associated with LILO. If you have a root partition that goes beyond the cylinder 1023 you will not be able to boot using LILO. Look for alternatives like boot floppies in such cases. This problem has however been overcome with the release of Red Hat 7.0.

2.3.1 Booting and LILO

If you have successfully installed LILO, then when you reboot the machine you will see the

LILO:

boot prompt. This basically will allow you to choose an OS to boot. Hit the tab key to see the various options to boot into. Enter the correct label to boot into the required OS. There can also be defined a default option which will be executed automatically after a specified time gap. This is useful because you need not be near the machine during every boot.

2.3.2 Configuration and updating

The configuration of LILO is in a file called /etc/lilo.conf. This is a ascii file and can be manually changed. The file contains two parts - the global part and the list of images. The global part has general information about the boot device, the boot mode, time out etc.

You may change the label and other information about the various images. You can for example install other kernels by adding information into this section. Information about the creation of kernels is beyond the scope of the current topic.

Don't forget to rerun /sbin/lilo to update the settings after changing the lilo.conf file.

You may also want to uninstall LILO. This can be done by running /sbin/lilo -u.

Congratulations, you now have a linux system up and running and also know the basics of what to do in case of problems that you may encounter. Now is the time to go ahead and start using the system.