10 – Installing Linux from CD-ROM

December 5, 2009 – 10:16 pm

Please note… This information no longer exists at the referenced locations.  This is only a copy of what was available in 2003.

Basic Linux Training™

Installing Linux from CD-ROM

Henry White

Table of Contents

Booting the Installation Media

You need to read the documentation that comes with your distribution because the actual setup and installation program you will use is specific to the distribution. Although they are all similar, each one is just a little different, with their own management tools and utilities, and a slightly different idea of where files should be, the default configuration, etc. Most of this documentation will be on your CD-ROM under /docs . (All the examples used here are Slackware specific, so your actual procedure may vary slightly, and may change from one version to the next.)

Note: At this point, you’re probably completely absorbed with getting through your initial installation, which is natural. The truth is that more likely than not you’ll be helping others with their installation and configuration a lot sooner than you may think. ;-) That’s all part of the Unix/Linux tradition. The first time is always the most difficult – just getting over the novelty is a major hurdle; the second time will be considerably easier, and the third even more so. If you can do it on one machine, you can do it on many machines. ;-) What will help you now, and will help others later, is to keep notes of what you’re doing, the choices you make, etc.

To install Linux, there are several source media from which to choose. You could download over the Internet by anonymous ftp and be assured of having the very latest version of the distribution, but it could easily take 10 to 20 hours to download the entire set of disk images using a 56K modem. It is also very boring and tedious because you have to make sure you exactly duplicate the directory structure and all files on your hard disk or floppies. Then you’ll get to waste a couple more hours disk swapping.

On the other hand, you could invest US$15-20 (including postage and handling) and get one of the multiple CD-ROM sets that includes the current versions of 3 to 5 of the major distributions (usually including some combination of Caldera, Debian, Mandrake, Red Hat, Slackware, S.u.S.E., and TurboLinux), or several CD-ROMs archiving the most popular ftp sites. This is what I recommend doing, rather than a shotgun marriage to the first distribution that comes along, or relying entire on someone else’s perhaps jaded opinions. ;-)

If you have an unsupported CD-ROM, you can use the CD-ROM distribution to make your floppies from the CD on your existing Windows partition, or set up a directory with subdirectories identical to what’s on the CD-ROM. It takes up a lot of space on your hard disk (each CD is ~640 MB), but after the installation you can safely delete all of it, and recover that space. If you have to go with floppies, make sure you label and date all of them. Also be sure to indicate on the floppies which distribution and version it is.

If you have trouble booting, refer to the information in Running Linux to force hardware detection. Also note that these parameters are called kernel parameters when entered at the boot prompt and have a slightly different format when included in /etc/lilo.conf where they are (appropriately) called lilo parameters . Although both do the same thing and work equally well, it is more convenient to include them in /etc/lilo.conf than to have to enter them manually each time you boot. This is, however, a great feature when troubleshooting – once you get the kernel parameters right, it is relatively trivial to enter them as lilo parameters in that file.

Creating the Partitions

All operating systems have fdisk or an analogue; you will use the Linux fdisk to create your partitions after you boot into the Linux installation program.

Set up your partitions in this order: swap partition, then your other partitions; / , /home , etc. There is nothing wrong with making one partition if you want to keep things simple. Just be aware that with a single partition you may have a hard time upgrading your kernel and other packages (particularly with Slackware), and you could lose all your configuration files during an upgrade unless you have a backup of them. If you create a separate partition for /home you won’t lose your email and other personal files, and you can save a copy of /etc there since it will only take a few MB.

Refer to Table 3.1 and Table 3.2 ( in Running Linux ) for the naming convention recognized by Linux, and remember that Linux (as does all Unix) begins counting with “zero” rather than “one”. IDE drives begin with /dev/hda , SCSI drives begin with /dev/sda – the last letter is the device (i.e., the hard disk), not the drive letter from DOS/Windows, so watch out for typing errors. For IDE the drive on the primary slave will be b. This may be a second hard drive or could be a different piece of hardware like the CD-ROM. The partition number will always be affixed at the end ( another source for mistakes ). More than likely, your DOS/Windows partition will be partition 1 , and your swap partition or first Linux partition will be 2 . If you’re using an extended partition, then the numbering always begins at 5 .

None of the data about your partitions will be entered until you write it to disk just before exiting fdisk , so check the partition table once more to make sure you have everything correct.

Note: Don’t be mislead by all the emphasis in Running Linux and in much of the documentation about a minimal installation – what they’re referring to is the absolute minimum that will boot; you’ll need considerably more for it to be practical and workable – more on the order of 400-600 MB. Similarly, a full installation includes all of the source code, which takes up a LOT of real estate and is not necessary since you have that on the CD-ROMs; also, you could create a major security problem having software installed that you never need or use. A practical and workable almost everything installation will run between 1200-1500 MB so allocating a 2000-3000 MB partition is more than enough. (Windows is widely known for code bloat and notorious as a memory hog, but any useful installation of Linux will require a sizable commitment of your hard disk – especially if you are going to use X and/or recompile your kernel. All things GUI are bloated, and the latest kernel source takes up ~116 MB on your hard disk.)

For what it’s worth, I run multiple distributions on my machine, and allocate the same 3000 MB for each. The exception to this is 6000 MB for S.u.S.E. 7.2 (all filesystems on that one partition).

Swap

If you are low on RAM (less than 16 MB), you should be able to get by fine running command line programs only; if you intend to run GUI you’ll need at least 32 MB. If you’re short, the best choice is to install more RAM. For the past couple of years it has been relatively cheap, so moving up to a more “respectable” amount of 64 MB or even 128 MB is not going to be too expensive.

The general rule of thumb about adding twice as much swap space as you have physical RAM is probably outdated. ;-) This came from an era when RAM was terribly expensive – on the order of US$11-15 per MB – and well appointed new machines were shipping with 4-8 MB. In fact, at the time 32 MB sticks were not all that common and anything larger than that almost certainly had to be a special order at most computer stores, so swap was the practical workaround. What the general rule of thumb was really telling you was that you needed a combined total of at least 8 MB for text based applications, and at least 16 MB for GUI. That was fine 5 years ago, but more practical minimums would be several times larger now.

Remember that swap is not equivalent to RAM, and it is a poor substitute. If you depend too much on swap, you will have to take a severe performance hit since your hard disk has much slower access times than RAM. Try to add as much RAM to your system as you can – if at all possible.

The type of RAM used in older machines eventually will become obsolete and no longer manufactured, so your only source will be to cannibalize other old machines. Also, on the new models, watch ( around a processor speed of 300 MHz ) for a shift to the new style P100 and P133 with an incompatible pin configuration. At some point you’re going to have to decide whether it is worthwhile to upgrade an old machine, or just junk it and move to something newer, with a much faster processor. ;-)

Creating the Filesystem

Before you can use the partition it will have to be formatted. Since the majority of files are generally small, using the slow format with sector check , and the smallest inode size ( 1024 bytes ) will help if you are short on storage space). With larger hard disks, the inode size will probably default to a much larger size – usually 4096 which works well. You definitely do not want to run out of inodes as long as you have free space on your disk, but you don’t want to get carried away with too many inodes either.

Most distributions have this integrated into the setup program, so it is taken care of for you. Enter the options, and take a break because this will take a few minutes. If you come back to a blackened screen, don’t panic – it is just a screen saver built into the operating system during inactivity; press the Space Bar and the screen will come back to life.

setup Program

From the Setup Menu you will have to make several choices, but generally you will follow the sequence TARGET – SOURCE – DISK SETS – INSTALL .

  • Target is the Linux native partition you just created
  • Source is whether you will be installing from hard disk, floppies or CD-ROM
  • Disk sets – You will have to select from each group of programs, but generally you will be safe going with the preselected default; if you choose Menu the program will not keep prompting you for more information with each disk set, and you can make all your selections at one time – otherwise you’re committed to sitting there for the next half hour or so, entering your choices for each disk set.

The actual installation can take 20 to 30 minutes, depending on your hardware, processor speed, and the options selected.

The only thing you have to watch for is DO NOT press Enter more than once! There may be a slight delay, so be patient. The setup program continues to accept keyboard input, so a second Enter will go beyond where you want to be in the setup program and you will probably not get the installation you wanted. If you make a mistake, generally it is best to continue rather than to try to bail out of the program. You can always go back to change things later.

Take a break or read the screens while the packages are being installed. (Some go by pretty fast, so you might not have enough time to read the whole screen. You will find most of your binary files under /bin , so you can check all this later.)

loadlin and lilo

lilo is a boot manager, and not easy for most beginners to set up correctly. If you’re interested in using this I strongly recommend that you install it during the setup program. I would advise you to not attempt to install this manually until you have more experience with Linux.

loadlin is much easier to set up, and will allow you to boot Linux from your DOS/Windows partition using a small directory with an kernel image that can be run from a batch file. (The zip file is lodlin16.zip under \kernels on the CD-ROM.) Unzip the file as follows:

    c:\>pkunzip -d e:\kernels\lodlin16.zip

The -d flag creates the directory structure and unzips the files into the correct location in c:\loadlin (created automatically).

Copy the appropriate kernel to this directory. If you used bare.i for example to boot for the installation program, in that same directory on the CD-ROM is zimage or bzimage that you will use.

    c:\loadlin>copy e:\kernels\bare.i\zimage .

[ Note the trailing dot ( . ) at the end. ] Check linux.bat to make sure that you have the correct name of the Linux partition you intend to boot (for example, /dev/hda2 ), and that the path and filename are correct (for example, c:\loadlin\zimage ). If you had to pass any parameters to the kernel in order to boot, include them in the batch file, put linux.bat in the path (or just copy linux.bat to C:\dos> ), and execute the batch file. You should be able to boot into Linux from anywhere in DOS by just typing in linux at the DOS prompt.

    c:\>linux

Essential System Management

One of the first things you should do after you have Linux up and running is to create an account for yourself and begin using it rather than logging in as root user every time. There are no limits to what you can do as root user – like totally wiping out Linux ; – ) or more likely corrupting it just enough to make certain things not work the way they should and making it hard to troubleshoot.

The adduser command will prompt you for a login name and full name. For now just accept the GID (group ID) and UID (user ID) by pressing Enter . The next prompts are about your home directory, shell, and password, followed by a summary verification. When you accept this, you will see a list of files being added and directories being created.

At this point, it might be wise to Exit to the login: prompt and login with your user name and password. This will check to make sure that it works, and prevents you from accidentally messing up your installation.

Get in the habit of logging in with your user name rather than as root unless you have to do system maintenance. As user you can also get temporary root privileges with the su command.

As user you are not likely to do irreparable damage; as root there is no limit to what you can do – a simple typo will be executed without the warning prompts you may be used to in DOS/Windows.

System Startup and Initialization

As Linux boots, the diagnostics are echoed to the screen. For the most part you can ignore error messages if you reach the login: prompt:

    Welcome to Linux 2.0.38
    darkstar login:

(If you installed networking capabilities, the name of your machine will replace darkstar .)

If you do not get to this login: prompt, read the screen for clues as to where the installation ran into a problem. (Ignore the error messages about hardware not installed on your machine – no matter which image you chose, the kernel will still look for certain devices.)

Log in as root . After you are logged in, you’ll see the prompt:

    darkstar:~#

where the tilde sign ( ~ ) is an abbreviation for home (which for root user is /root , and for others is /home/username with the $ prompt).

Single User Mode

The first thing you need to do is add yourself as a user to the system and create your home directory.

    darkstar:~# adduser

You will be asked for the login name for the new user, the full name, the user ID (UID) [ just accept 501 by pressing Enter ]; then you will be asked to verify your home directory, shell ( /bin/bash ) and password. The information will be presented again for verification, and you will see a list of symbolic links to your home directory.

Now you can exit as root and login as username. Get in the habit of using your username rather than login as root all the time. If you need to do some system maintenance, issue the command su (substitute user). If no username is given, su will change to the superuser giving you root privileges. It can also be used to change to any user on the system by just adding the username.

Shutting Down the System

There are two ways to properly shutdown:

  • If you want to boot back into DOS/Windows, exit all programs back to the login: prompt (to make sure you do not have any processes running) then warm boot with Ctrl-Alt-Del (sometimes known as the Vulcan Nerve Pinch or the three finger salute, if this is present in /etc/inittab ); or you can issue the command:
        $ shutdown -r now
    

    which does precisely the same thing – reboots the computer.

    (Please note that Ctrl-Alt will be on the left of your keyboard, the META keys.)

    If you are finished with the computer and want to turn it off, you can issue the command:

        $ shutdown -h now
    

    Wait for the system to prompt you:

        System halted.
    

    It is then safe to turn off the computer.

Assignments

Terms and Concepts:

Define and add these to your glossary:

  • hard drive geometry
  • LILO
  • loadlin
  • makebootfloppy
  • mount

On line:

Objective 3


Copyright © 1997-2003 Henry White. All Rights Reserved.
Reproduction or redistribution without prior written consent is strictly prohibited. Address comments and inquiries to info@basiclinux.net
.

Sorry, comments for this entry are closed at this time.