Basic Linux Training
Lesson 4: Installing from CD-ROM
Table of Contents
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.
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.)
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.
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.
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 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.zipThe -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.
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.
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).
darkstar:~# adduserYou 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.
$ 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:
It's then safe to turn off the computer.
Terms and Concepts:
Define and add these to your glossary:
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.
While you're there, check out the current issue and some of the articles.
With any suggestions or questions please feel free to contact us