Notice: This material is excerpted from Running A Perfect Internet Site with Linux, ISBN: 0-7897-0514-1. The electronic version of this material has not been through the final proof reading stage that the book goes through before being published in printed form. Some errors may exist here that are corrected before the book is published. This material is provided "as is" without any warranty of any kind.

Copyright ©1996, Que Corporation. All rights reserved. No part of this book may be used or reproduced in any form or by any means, or stored in a database or retrieval system without prior written permission of the publisher except in the case of brief quotations embodied in critical articles and reviews. Making copies of any part of this book for any purpose other than your own personal use is a violation of United States copyright laws. For information, address Que Corporation, 201 West 103rd Street, Indianapolis, IN 46290 or at support@mcp .com.

Chapter 4 - Installing Linux from the CD-ROM

You've finally made it to the last preliminary step before you can set up your Internet site. It's time to actually install Linux. Fortunately, this is the easier part of setting up the program. You already did the hard stuff! These days, the installation is largely an automated process: you make your choices and the software is installed for you.

In this chapter, you'll learn:

Starting Your Linux Installation

All you have to do to begin setting up Linux is type setup at your prompt! From there, follow the choices you're given, and take your time answering the questions. You probably feel like rushing through this section so you can get your site up and running, but don't. You'll be much happier if you don't have to reinstall everything again because you missed something!

If you shut your system down between Chapter 3 and now, remember you need to boot using your boot disk, then your root disk. Also, you can remove your root disk once you reach the login prompt.

The following are error messages to watch out for:

A lock file is used to tell a program that something is in use. For example, in this case, the installation program tries to run itself and finds a file that tells it it's already running. Lock files are supposed to be erased by the programs that created them, but if they exit abnormally sometimes this will not happen.

Installing Linux

As I said in the previous section, take your time. You can always reinstall if you need to, so don't get nervous!

First, type setup at your Linux prompt. What you see from now on depends on which root disk you chose. I'll walk you through the text installation because that's what I selected. However, both versions of the installation have the same goal and will produce similar results.

If you use color, you'll get a menu-driven installation system. You'll have to consider the same items as you would with text, but they'll be presented differently. No matter which root disk you choose, there are sufficient instructions to walk you through the installation process. Just take your time and read everything that appears on your screen.
The reason the color installation isn't covered in this book is that it doesn't work on particular systems. Also, the text version gives more detailed error messages if you run into problems during your install.
As I discussed in Chapter 3, feel free to try the color installation. The decisions you have to make are the same in both versions, just presented differently. You can always reformat the drive and start over if you need to.

After typing setup, you will go through a process similar to the following:

Welcome to Slackware Linux Setup (v. 3.0.0-tty)

Linux supports many different keyboard configurations. If you are not 
using a US keyboard, you will probably want to remap your keyboard.

Would you like to remap your keyboard?

1 - yes
2 - no

If you're not using a standard United States keyboard, then select option one. Otherwise, select two.

Slackware Setup has detected a swap partition:

/dev/hdb1          1     1     40     16772          82     Linux Swap

Do you wish to install this partition as your swapspace ([y]es, [n]o)?


IMPORTANT NOTE:  If you have already made any of your swap partitions 
active (using the swapon command), then you should not allow setup 
to use mkswap on your swap partitions, because it may corrupt 
memory pages that are currently swapped out.  Instead, you will 
have to make sure that your swap partitions have been prepared (with 
mkswap) before they will work.  You might want to do this to any 
inactive swap partitions before you reboot.

Do you want setup to use mkswap on your swap partitions ([y]es, [n]o)?

Since we already did swapon to activate our swap partition, type n here to avoid the memory problems warned of above.

Then, type y to be able to use your swap partition.

The numbers that follow are an example. The numbers for your drive will be different.
The following partitions on your machine are available for Linux: Device Boot Begin Start End Blocks Id System /dev/hdb1 1 1 483 202832 83 Linux native /dev/hdb2 506 506 988 202860 83 Linux native Which device would you like to use for your root Linux partition?

The question Which device would you like to use for your root Linux partition? will not appear if you only have one root Linux partition set.

In my case, I will have two different Linux installations on this drive. I want my new Linux installation to be on /dev/hdb1, so that's the name I'll type in here. Hit Enter.

In my case, I could also choose to write over the old Linux partition on /dev/hdb2. First I would have to go back to the end of Chapter 3 and reformat it though to make sure it's blank.
I picked /dev/hdb1 because it used to be an MS-DOS partition on this drive, and now I'm going to install a new Linux version here. Normally, you won't have two Linux versions on the same drive, I'm just being redundant because I need access to the older one for now.
If this is the root partition of an existing Linux system, you may add more software to the existing system, or you may reformat the partition and install from scratch. Would you like to [a]dd more software, or [i]nstall from scratch?

Type i unless you're just adding more software packages at the moment, then hit Enter.

There are two main filesystem types that are used for Linux. There 
are the xiafs filesystem, and the second extended filesystem (ext2). 
If you are adding new software to a system that has already been 
installed, you must enter the filesystem type it currently uses. 
If you're installing to a new system, you can try either filesystem 
type.


By either filesystem type the installation program is referring to the filesystems xiafs or ext2.
Which of these two filesystems to use is one of those things that some Linux users like to argue about needlessly. Both are good filesystems, and it's hard to say whether either one has a significant speed or reliability advantage. Ext2 does have one nice feature to it that xiafs doesn't have yet-as an ext2 partition is unmounted, a clean bit is written to it. When the machine is rebooted, checking is skipped for any partitions that have the clean bit on them. For this reason, ext2 systems boot faster than xiafs systems, unless you disable the automatic filesystem checking in /etc/rc.d/rc.S. If you use xiafs for your root partition, you'll see some warnings when you shut the system down. These are harmless and can be ignored. What filesystem do you have (or do you plan to use) on your root partition (/dev/hdb1), [e]xt2fs or [x]iafs?

Note that the last sentence refers to the root partition you defined a couple of steps earlier. Now, if you have any preferences, go ahead and follow those. I recommend ext2fs due to the reasons given above such as a faster booting system, so I will type e. If you would like to use the xiafs file system type x.

Since you've chosen to install Linux from scratch, we want to be 
sure you know how to proceed, and we also want to give you one 
last chance to change your mind. When using this option, you must 
install to a blank partition. If you have not already formatted it 
manually then you must format it when prompted.

Enter [i] again to install from scratch, or [a] to add software to 
your existing system.

Install fresh, or add software to your current system? ([i]nstall, 
[a]dd)?

Once again, if you're installing a brand new version of Linux, type i. If you're adding more software to your setup (for example, perhaps you realize later you wanted a package that you said no to before), type a.

Would you like to format this partition ([y]es, [n]o, [c]heck 
sectors too)?

If you followed the steps in the previous chapter completely and formatted your Linux partition, feel free to type n for no. If you'd rather err on the side of caution, go ahead and type y for yes. I don't recommend c for check sectors unless you want to wait quite a while, as it can take hours to check every sector of a larger hard drive.

If you have more than one Linux native partition on your drive, you'll be given the opportunity to mount large directories on another partition at this point. If you'd like to split some things up between different partitions, that's not a problem. It's best to do it through the install program if you're going to do it at all, because a lot of packages won't work or won't work properly if you move them to anything other than your root partition.

Now, the install program checks to see if you have any extra FAT partitions for DOS (FAT) or OS/2 (HPFS). If you do, you'll be given the option to make these partitions visible from Linux. If you'd like to be able to access them, type y. If the non-Linux partition is compressed (which means Linux cannot access it), or if you don't want people to be able to get to your other partition without rebooting, type n to not be able to access it.

SOURCE MEDIA SELECTION

1-Install from a hard drive partition
2-Install from floppy disks
3-Install via NFS
4-Install from a pre-mounted directory
5-Install from CD-ROM

From which source will you be installing Linux (1/2/3/4/5)?

If you're installing straight from the CD-ROM that came with this book, type 5. If you put the installation material on floppy disks and are installing from disk, type 2. If you're installing from one of the other methods listed above, type the appropriate number. You'll be asked to indicate where precisely you're installing Linux from (which drive, for example). Answer the questions appropriately.

If you choose 5 for CD-ROM, you are given the following list of models to choose from:

INSTALLING FROM SLACKWARE CD-ROM

1-SCSI [ /dev/scd0 or /dev/scd1 ]
2-Sony CDU31A [ /dev/sonycd ]
3-Sony 535 [ /dev/cdu535 ]
4-Mitsumi [ /dev/mcd ]
5-SoundBlaster Pro (Panasonic) [ /dev/sbpcd ]
6-Aztech/Orchid/Okano/Wearnes with interface card [ /dev/aztcd ]
7-Most IDE/ATAPI CD-ROM drives
8-Scan for your CD-ROM drive automatically

CD-ROM type (1/2/3/4/5/6/7/8)?


CHOOSE YOUR INSTALLATION METHOD

With Slakware, you can run most of the system from the CD-ROM 
if you're short of drive space or if you just want to test 
Linux without going through a complete installation.

slakware	Normal installation to hard drive

slaktest	Link /usr->/cdrom/live/usr to run mostly from CD-ROM

Which type of installation do you want (slakware or slaktest)?

You are creating a full Internet site, so you definitely want to type slakware here.

Now, it's time to tell the install program which disk sets you want to use. If you're using text, you get a list of the disk sets, as shown in Chapter 3, "Getting Ready to Install Linux from the CD-ROM," and a list of what package each disk set contains. If you're using color, you'll be asked a list of questions about whether you want to use various packages.

The items you definitely want to install are:

Item	Description
A	Necessary system disks. You must install this set.
AP	General Linux applications that don't require X Windows.
D	Development tools. You may not feel you need these because you don't see yourself as a programmer. However, as a system administrator you have to compile applications and do a bit of programming work, so it's important to have the proper tools installed.
E	The Emacs editor. You will likely want to use this editor on your system.
F	FAQ and HOWTO files. These will help you if you want to do things that aren't covered in this book.
N	Network utilities. Considering you are setting up an Internet site, you will want network utilities!
Y	Games that don't require X Windows, if you want them.

If you want X Windows, you'll at least want:

For the rest, take a look at them. Remember, you can go back and install other packages later if you're not sure you want them now.

Once you've told the install program which disks you want to use, follow the prompts to install everything, choose Prompt mode so you can select the specific packages you want to install on each disk set. Then, when given the option to use special tagfile extensions, press Enter to use none, since we're not using any custom installation files.

If you're installing from CD-ROM, the next part is minimal effort. If you're installing from disk, hang in there with the disk switching!

Install anything on the disks you selected that has the priority Recommended. It will use a bit more disk space than it might otherwise, but it takes some experience to know which packages you want for what you want to do and which you don't for your needs.

When it comes to packages marked as priority Optional, I recommend you install the following:

Once the system disks have been installed, you have the option of creating a boot disk. This boot disk will be specific to the configurations you choose, while your original boot disk is more generic.

This boot disk must be the same size as the other boot disk you made. This is because you must be able to use it with your root disk, and both the boot and root disks must be of the same size: your system looks for both disks in the same drive.

Therefore, go ahead and create another boot disk, and label it something like "Boot Disk, After Installation." Keep this in a safe place with your other boot and root disks (you'll use the new boot disk in emergencies, but having the other one around can be handy if something goes wrong with your new one).

Next in the text progression, the install program offers to install the following devices in this order:

  1. Modem
  2. Mouse
  3. CD-ROM

For each device, answer y if you want to install it and n if you don't. If you answer yes, you'll be asked for detailed information on its location (modems), or its brand, etc., (mouse and CD-ROM). Just take your time, and make sure you answer the questions correctly so you don't have to turn around and fix things later.

As I discussed in Chapter 3, since the boot disk you choose contains your CD-ROM driver, you are able to install from the CD-ROM. Much faster than installing from disk!

You next get the chance to try out some custom screen fonts. If you want to give them a try, type y. I find that the standard fonts are easier on the eyes, so I stick with them. You can certainly take a look at the options and choose for yourself. If you'd like to stick with the standard screen fonts, type n.

If you installed Ftape, a tape backup program, you'll next get a prompt asking you if the Ftape module should be loaded at boot time. If you want to activate Ftape at boot time so you can back up your system, type y. If you don't intend to back up your system to tape, type n.

If you purchase a tape backup system in the future, or find that you want to install another package off the CD after installing, you don't have to go through the install process again. To install something from the CD, do the following:
  1. Log in as root
  2. Locate the package on the CD-ROM
  3. Copy the appropriate .tgz file (e.g. ftape.tgz) to the / directory (same thing as .tar.gz)
  4. Uncompress the file with the command gunzip ftape.tgz (substitute the appropriate package name). You will get a file with the same package name, but a .tar extension.
  5. Untar the file with tar -xvf ftape.tar (substitute the appropriate package name). This will unpack the file and place it in the appropriate directories, relative to the / directory. It will also set the appropriate permissions.

Next, you're given the opportunity to set your default modem speed. You can change this value later, so don't worry too much if you're not exactly sure what you want to use. Select the option your modem can best support (if you're using a modem)for now, and press Enter.

Installing LILO

At this point, you've installed most of your Linux system. Now you need to decide if you want to install LILO. LILO is the Linux Loader, a program that lets you tell your computer what operating system or kernel to boot with.

Be sure to have boot disks available for any other operating systems you may have on this drive. If something goes wrong with your LILO installation, your boot disk will be the only way to get back to that OS until your LILO setup is fixed.

The LILO installer gives you the following options:

  1. Start LILO configuration with a new LILO header
  2. Start a new LILO. If you have an old one, this will overwrite it when you save. However, if you don't have a LILO configuration set up yet (perhaps from a previous version of Linux), this won't erase anything.
  3. Add a Linux partition to the LILO config file
  4. Start to configure LILO to know how to boot up your computer into Linux.
  5. Add an OS/2 partition to the LILO config file
  6. Start to configure LILO to know how to boot up your computer into OS/2, if you have an OS/2 drive or partition.
  7. Add a DOS partition to the LILO config file
  8. Start to configure LILO to know how to boot up your computer into MS-DOS, if you have an MS-DOS partition.
  9. Install LILO
  10. Save your LILO settings.
  11. Reinstall LILO using existing lilo.conf
  12. Your LILO data is in /etc/lilo.conf. If you install Windows 95 after installing Linux (which erases your boot sector and thus gets rid of LILO), you can select this option to copy your LILO settings from the file to the boot sector of your hard drive.
  13. Skip LILO installation and exit this menu
  14. If you decide you're not sure you want to install LILO at the moment, select this option to exit without saying.
  15. View your current /etc/lilo.conf
  16. Take a look at what you have so far in your LILO settings.
  17. Read the Linux Loader HELP file
  18. Read the online help for LILO.

Since this is your first time using LILO, pick option one. First, you'll be given the chance to enter any extra parameters you need to use at boot time. These are the same parameters you had to consider when booting with the boot disk you made in Chapter 3, "Getting Ready to Install Linux from the CD-ROM," (your first boot disk). If you have any extra parameters, enter them here. Many people won't have any and will just hit Enter.

Whenever you're at the LILO main menu (the list above), you can choose option eight to see what your current LILO settings are.

Next, you'll select where you want to install LILO. Recommendations are given, such as where to put it if you're using OS/2's boot manager. Also, if you're nervous about overwriting the master boot record of your hard drive (which isn't really as dangerous as it sounds; it just means that you need to take your time and not forget any of your existing partitions) you can install LILO to a floppy.

Keep in mind that as long as you can get into your Linux partition with your (newer) boot disk later, you can change your LILO settings and fix any problems. For most people (except those with OS/2), you'll want to go ahead and install it on your master boot record. Select the option you want, and press Enter.

If you're concerned about your boot sector getting overwritten, install LILO to a disk as well. Mark it clearly and insert it in the drive before you turn on your computer to use it. Setting the length of time it should wait (discussed next) to 0 will tell it to just boot straight into Linux.

Choose how long you want LILO to wait before it starts it's default boot. I'd recommend at least five seconds because if you're upgrading kernels, you can use LILO to boot into a new kernel to test it without losing your old kernel. Once you've selected the option you want, hit Enter and you'll go back to the main LILO menu.

Now, you'll want to add your partitions to your LILO config file. I'll walk you through adding the Linux partition, which is option two:

  1. Select the Linux partition you want LILO to boot with by typing the device name (i.e. /dev/hdb1).
  2. Enter the name you want to type in when you're booting with Linux (as LILO recommends, "linux" is a nice, easy to remember choice).
  3. Return to the main LILO menu.

If you have an MS-DOS partition, then select option three. Using "dos" or "msdos" for telling LILO to boot with MS-DOS is a good choice because it's easy to remember.

If it would make you feel better, select option eight to double-check your LILO settings. When you're finished, select option five.

If you installed LILO to a floppy disk, be sure to label it clearly and keep it with your other important Linux disks!

Finishing Your Linux Installation

Now that you've got LILO installed, we can finish the installation. If you think this takes a while, think of how long it took before the installation program was available! It's nice to be able to just make your choices and let the program do the rest.

You'll be given a chance to configure your network. You should choose y for yes since you're going to be running an Internet connection. The network configuration section asks for the following information, in this order:

  1. Your host name. This is just the name of this particular computer, and doesn't include your domain name. For example, my computer is known to the Internet as catherine.renaissoft.com, but the host name I'll enter is "catherine."
  2. Your domain name. This is the name by which the Internet knows your network. In my case, this is renaissoft.com.
  3. Whether you want to use TCP/IP for anything but loopback (a closed system). Choose n for no since you are setting up an Internet site, so you'll be using your TCP/IP for more than just loopback. You would choose yes for an isolated system.
  4. Your machine's full IP address. My machine's is 199.60.103.2.
  5. Your machine's gateway IP address. The gateway is the server your machine goes through to get to the Internet, the server itself. It will end with a 1 (e.g.,. 199.60.103.1). If you've only got one machine, then its address will be the gateway address as well.
  6. Your netmask. This will be 255.255.255.0 for a class C address (like mine), 255.255.0.0 for a class B, and 255.0.0.0 for a class A.
  7. The installer creates the necessary files, and then asks if you'll be accessing a nameserver. Answer y for yes.
  8. If you're setting this up on a computer that is not your server, enter the IP address of your server (e.g., 199.60.103.1). If you're setting this up on your server, enter the IP address of the computer it looks to on your provider's end for nameservice.
  9. The installer saves the remaining information for your network configuration.

As the install program points out, you can type netconfig at your Linux prompt later to change these settings if you realize you set something incorrectly.

The installation process continues as you're asked if you'd like gpm installed. This is a program that allows you to cut and paste between virtual windows in X Windows. I highly recommend you install this option if you're going to use X Windows; it's great for transferring information from one place to another. If you want gpm to run when you boot, type y for yes. If you don't, type n for no.

At this point we're at the sendmail configuration section. Sendmail is one of the programs available to you to handle your e-mail. Here's what the install program will want to know for your sendmail configuration:

  1. If you want a sendmail configuration file created for you, say y at the prompt. Since you will use sendmail as your mail server, choose yes.
  2. You're offered a choice between three different configuration files (pick option one since your site will be on the Internet), or you can change your mind and not installing the config file. I recommend you go ahead, though you can certainly come back to it later per the instructions on your screen.

Finally, the Linux installation program lets you configure your time zone, as follows:

  1. You're given the option to configure your time zone. Go ahead and press y for yes.
  2. A list of time zone choices is displayed. Type in one of them and press Enter. For example, I entered Canada/Pacific.

That's it! Congratulations, you've gotten through a run at installing Linux. Go ahead and reboot to take a look (hitting the Alt or Ctrl key when LILO shows up on your screen). If you find you're not happy with some of the choices you've made during the installation, or your disk space is low, you can certainly wipe the disk clean and start over again.

QUE Home Page

For technical support for our books and software contact support@mcp.com

Copyright ©1996, Que Corporation