Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




Basic Linux Training

Lesson 4: Installing from CD-ROM


Table of Contents


Booting the Installation Media

You need to read the documentation that comes with your distribution because the actual setup program you will use is specific to the distribution. Although they are all similar, each one is just a little different. 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 version to the next,)

Eventually, all the distributions pick up features from each other. and one that is sure to be added soon by all the distributions is how Debian installing directly from CD-ROM without the need to create floppies, or a couple of the S.u.S.E. tools - Y.a.S.T. and susewm that simplify installation and maintenance of the installation and modifying your resource files for all your window managers with one tool.

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 that will easily take 8 or 10 hours to download the entire set of disk images. It is also very boring and tedious because you have to make sure you duplicate the directory structure and all files exactly on your hard disk or floppies. Then you'll get to waste a couple more hours disk swapping. Or you could invest US$15-20 and get one of the multiple CD-ROM sets that includes the current versions of Red Hat, Slackware, and Debian, plus several CD-ROMs archiving the most popular ftp sites.

If you have an unsupported CD-ROM, you can use the CD-ROM distribution to make your floppies or set up a directory on your DOS partition with subdirectories identical to what's on the CD-ROM. It takes up a lot of space on your hard disk, but after the installation you can delete it. If you have to go with floppies, make sure you label and date all of them, and include the distribution name and version.

Slackware also has the option of doing a partial install, leaving most of the files on the CD-ROM and running Linux from there. It is slower, of course, and you don't get X, but you will only need about 10 MB free space to try it; if your CD-ROM drive is fast, this may be acceptable, at 2x it is going to be, but it will work. (Not all distributions support this option.)

If you have trouble booting, refer to the information on pages 55-58 (Running Linux) to force hardware detection.


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 setup program.

Set up your partitions in this order: swap partition, then your other partitions; /, /usr/src, /home or however you have decided to set it up. 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 could lose all your configuration files unless you have a backup of them.

Refer to Table 3.1 on page 59 and Table 3.2 on page 60 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, not the drive letter from DOS/Windows, so watch out for mistakes when you enter. Your second hard disk will be b, etc. The partition number will always be affixed at the end, another source for mistakes; more than likely, your DOS/Windows partition will 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, so check the partition table once more to make sure you have everything correct. (One personal note: don't be mislead by all the emphasis in Running Linux and much of the documentation about a minimal installation. 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. A few years ago there was a premium on hard disk space and RAM, but hardware prices have fallen dramatically and trying to squeeze Linux into a minimum space is no longer the primary concern. The printed volumes need to be revised to reflect that.)


Swap

If you are low on RAM (less than 16 MB), you might want a swap partition; if you have less than 8 MB, you really do need one - large enough to total 16 MB or more (32 MB would be better).

Remember that you will have to take a severe performance hit since your hard disk has much slow access times than RAM. Try to add enough RAM to your system if at all possible.


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).

Most distributions have this integrated into the setup program, so it's 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's just a screen saver built into the operating system during inactivity.

One of the nasty little secrets is that if you do not have enough disk space, the setup program will not cease and desist, but run along merrily as if you did. Of course, the end result is that you're installation is probably not going to work properly, if at all, and some of your programs will not be on the disk.


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 probably will not the installation you wanted. If you make a mistake, generally it's best to continue rather than try to bail out of the program. You can always go back to change things later.

Take a break, 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 to boot, include them in the batch file, put linux.bat in the path (or just copy it to C:>dos), and execute the batch file. You should be able to boot into Linux 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 not 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 addusr 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 screen. For the most part you can ignore error messages if you reach the login: prompt:
         Welcome to Linux 2.30.0

         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, user ID (UID) (just accept 501 by pressing Enter), then you will be asked to verify your home directory and 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 (superuser) which gives you root privileges.


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.

    (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's then safe to turn off the computer.


Assignments

Textbook: Running Linux
  • Chapter 3: Installation and Initial Configuration, p.53-83

Terms and Concepts:

Define and add these to your glossary:

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

Online:

Check the Linux Gazette additions to Matt Welsh's Installation and Getting Started Guide if you are using Slackware, Red Hat, Debian, or S.u.S.E.


 
 

Go to Basic Linux Index


http://home1.gte.net/henryw/basic/basic04.html

Date last revised: 15 May 1998


Copyright © 1997, 1998 Henry White. All Rights Reserved.
Reproduction or redistribution without prior written consent is prohibited.
Address reprint requests and other inquiries to henryw@gte.net.



With any suggestions or questions please feel free to contact us