Installing Red Hat 7.1
path › xlifecolumns20011123

Installing Red Hat 7.1

Xlife column for November 23, 2001:
Summary:
I describe the general installation procedure of an Red Hat Linux operating system. It does not cover everything and is just meant to get you on your way.
  1. Where to get Red Hat from
  2. Getting started
  3. What are partitions?
  4. Setting up the hard-disk partitions
  5. Starting the Red Hat Linux installation
  6. Actually installing Red Hat Linux
    1. General options
    2. Partition setup
    3. "Drives" naming under Linux
    4. The LILO 1024 cylinder warning
    5. Some more general options
    6. Package selection
    7. Preparing the system
    8. Important! The boot disk
    9. Setting up X Windows
  7. You're done!

Please remember I set this system up for my own needs. I use it to run multimedia applications (watch movies and listen to music); I connect to the Internet by dial-up only and I need some Internet applications (file download, e-mail, browsing); I set up a development environment, including some web and database servers, text editors and CVS. I won't tell you how to set all of these up in this column, but maybe I will in future ones. Also, please pay attention to issues specific to my hardware and preferences, since stuff that could be important to you will be overlooked or specifically kicked out if you do things my way.

1 Where to get Red Hat from

The most usual way to get your hands on a Red Hat system these days is to download two or three CD images (ISO's) and make CD's out of them. You'll need a CD-writer and blank CD's. 640 MB regular blanks will do just fine, you don't need 700 MB.

You can get the ISO's here or at the official Red Hat site. There are lots of people mirroring the ISO's on servers that are probably closer to your location, so check around first. How exactly you do the downloading and the writing of the disks is your problem. Just consider it a starting exercise in the "manage it" spirit of Linux.

If you're lucky, you'll find a knowledgeable friend willing to help you out (maybe he's already got the CD's and he's willing to make copies for you). You can always pay Red Hat to send you a full package with all kinds of goodies included.

Please note that the standard Red Hat distribution actually consists of several CD's. Some of them are essential; other will contain documentation, the powertools (a large collection of additional applications -- as in, not crucial) and source RPM's (source code).

2 Getting started

I'll assume you have the Red Hat CD's in front of you, and you're ready to start installing Red Hat Linux on your computer. Well, not so fast. We'll have to do some other stuff first.

First of all, let's see how Linux will fit together with what else you've got on your machine. I for one will also be running Windows 98SE and we need a way to split the hard-disk between the two of them, as well as a nice confortable way of switching between them.

Secondly, you'll need a way to start the install operation. If you can boot from CD it's great, if not there's a way to do it using floppy disks.

3 What are partitions?

Splitting the disk is done by partitioning it. Disk partitions are slices which are treated as different parts of the disk by the operating system, thus enabling you to set them up for different things. Here's how I set them up on my system:

  • A partition where I install the actual Windows 98 OS, and which I will use to start it (800 MB).
  • A (big) partition where I keep pretty much everything I need under Windows as well as some stuff I'll need under Linux: games, install kits, documentation, images, movies, software (I never install stuff in C:\Program Files if I can help it, I use D:\Software instead), music, documents and so on (15 GB).
  • One partition where Linux will live (4 GB).
  • A partition used by Linux as memory swap. A good rool of thumb here is to make it as big as the amount of RAM you've got, so it will be 128 MB big. Actually, the more RAM you have the less you'll need the swap partition, so if in the future I buy more RAM I won't need to worry about resizing the swap partition.

(In case you're wondering why I set up things like this; I separate the Windows basic stuff on C: from everything else on D: because if something goes wrong (system crash, viruses) and I need to reinstall the system, I can go ahead and format C:, then reinstall without losing anything important. As for the two Linux partitions, they need to be set up like this, it's the absolute minimum requirement.)

4 Setting up the hard-disk partitions

Let's go about some common scenarios of setting up partitions.

  1. You've got an empty hard-disk. Use the Windows98 install disk to boot and start the computer with CD-ROM support, not the install program. You'll reach the command prompt and run the fdisk utility. Use it to set things up like this: make a primary partition 800 MB big (Windows 98 really doesn't need more) and an extended partition accross the rest of the disk.

    Inside the extended partition make a 15 GB DOS partition. Now reboot and proceed the same way as the first time, until you reach the command line. Use format C: and format D: to prepare the two partitions you've just created for use by Windows.

    When you're done reboot and this time start the Windows installation program. It will check the two partitions again and finally you'll get to install Windows on C:. If you lose the stuff you don't need in the application selection screen you'll end up with around 250 MB occupied on C: It will fill up later with all kinds of stuff, but if you don't install software in C:\Program Files but in D:\Software as I do you'll always have at least 150 MB free on C:

    That's it, now start the installation from the Linux CD's (see below). You'll get to set up the Linux partition during the install.

  2. You've already got Windows installed and taking up the whole hard-disk. You may have one big C: partition, or maybe two or more partitions (some people use C: for Windows, D: for software, E: for games and so on). If this is the case, use applications like fips or Partition Magic (the first is more difficult to use, but works equally well) to set things up.

    What you'll need to do is resize one or more of the existing partitions in order to make room for the Linux ones. The absolute minimum recomended size for the Linux partitions is 1 GB for the main one and 128 MB for swap. Check if this can be accomplished by adding up the free space on all the existing partitions. You'll need to come up with (or free) 1128 MB for this to work.

    Use Partition Magic to resize and move the existing partitions until you've got the needed space free (as in no partition on it). It helps a lot to also create the Linux partitions now, because it's easier for a beginner to have them set up and just use them when you install Linux rather than creating them later. The whole process will take some time, depending on how big the whole hard-disk is and how much data needs to be moved around to accomodate the changes.

    When you're done start the Linux installation from the first Red Hat CD (see below).

  3. You could also have another Windows version installed on your computer. Windows 95 should work out the same as 98. Windows 2000, ME, XP or NT could be a little different, because they need more space for the actual operating system, so you may want to be careful and not make the main Windows partition 800 MB; 1 GB or 1.5 GB is more like it. Other than that, Partition Magic will work just as well on these Windows versions. You'll need to work out various other issues with each of them, so please refer to specific documentation.

5 Starting the Red Hat Linux installation

If your computer can boot from CD it's great. You'll just have to go into the BIOS setup and tell it to do so, or maybe it's already set up to do this. Put in the first Red Hat CD, reboot and you're on your way.

If you can't use the CD-ROM to boot you'll have to go a different way. On the first Red Hat CD there's an utility called rawrite which can fill floppy disks with stuff from a pre-existing disk image. The images are also provided on the CD, so go ahead and make yourself a floppy disk, read the Readme file on the CD to find out how. When you're done make sure you boot from the floppy disk you've just made, and that the first install CD is in the CD-ROM drive. The booting sequence will know how to transfer you to the CD and start installation.

6 Actually installing Red Hat Linux

Whether you boot from CD or floppy disk, you'll end up in front of a text screen with a prompt at the bottom. Type in "text" and press Enter. You've just told the install program you want a text based GUI for the installation, since it's the most reliable. Don't worry, it's not some cryptic command line installation process, it actually looks very pretty.

6.1 General options

Some quick walkthrough for a bunch of simple options you'll encounter:

  1. Select English language for the installation program.
  2. Most people will select "us" keyboard. Unless you need some other type (like if you're French and have a French keyboard).
  3. Say you want to set up a "custom system". This is important! If you say something else the program won't let you customize what gets installed and instead choose for you.

6.2 Partition setup

Now you've reached the partition setup. Choose "disk druid" as the tool for the job. "fdisk" is actually the Linux fdisk, not the DOS/Windows version, so take care. Disk Druid will present you with the existing partitions and ask you to choose which one will be the main Linux partition. You can create, delete and modify partitions.

On my system I am presented with four partitions: two DOS (FAT32) ones, one of type "Linux native" and one "Linux swap". I don't need to worry about the swap, Linux knows how to use it without any special intervention. What I need to do is tell it that the Linux native partition should be used as the main installation point, and I do this by editing it and specifying "/" (slash, without the quotes) as the "mount point". After which I'm done, I move on (OK or F12).

If you only see FAT32 partitions you will need to create Linux partitions. You must have enough free space as discussed before (at least 1 GB + 128 MB). Unlike Partition Magic, Disk Druid works with the existing space, it's not capable of resizing. So if you have the space go ahead and create a Linux native partition with a "/" mount point, plus a Linux swap. Otherwise, reboot into Windows and use Partition Magic.

Quick note (so you'll be smarter than the average Linux beginner): under Linux, you don't have "drives" like under DOS/Windows. What you have instead is directories, all grouped under the root directory, called, you've guessed it, "/". The simplest way to set up the disk is to have a partition for / and a swap, end of story. However, some people prefer to set up some directories on the Linux system to be on their own partition. For example, /tmp is a directory used by all the applications for holding temporary runtime files and data. If you put /tmp on a separate partition you can accomplish several useful things: for example, you can later convert it to a ReiserFS file system which is better for the kind of disk usage /tmp needs; or, in case of a remote attack which attempts to fill up your entire disk, it only fills up /tmp. The same goes for some other standard Linux directories, such as /home, the place where users keep their individual files (how about making sure your little brother won't have any chance to go over a fixed disk space?).

If you wan't to set directories to use different partitions, ask a friends who knows this stuff to help you decide how much space you should set for each important directory. Once you've settled to a scheme you just create partitions inside Disk Druid and use mount points other than / for them (/tmp, /var/spool, /home, etc.).

6.3 "Drives" naming under Linux

As I said, there are no drives under Linux. All hard-disk partitions and other devices that are considered disk space (floppy disks, CD's) are hooked into the root directory tree under certain directories and used like that. Need to read from CD? You "mount" it under /mnt/cdrom, which was previously empty, but now you find the root of the CD in there. We'll discuss this later.

What could be of interest right now is knowing what Linux calls the hard-disk drives.

You may know that an usual main board has two IDE controllers, each capable of holding up to two storage devices, such as hard-drives or CD-ROM's. You have a primary controller and a secondary controller. The deviced on each are separated into "master" and "slave". So you have masters and slaves, primary and secondary controller; four combinations altogether. Linux will call these "devices", and name them hd?, where the question mark will be a letter from a to d.

  • primary controller, master device: /dev/hda
  • primary controller, slave device: /dev/hdb
  • secondary controller, master device: /dev/hdc
  • secondary controller, slave device: /dev/hdd

In my computer I have the hard-drive set up as hda, and the CD-writer as hdc. From the above you can deduce what controller and device type they use.

Furthermore, unlike CD's and floppy disks, hard-disks have partitions. We have to call them something as well. Since Linux uses the partitioning schema used by early MS-DOS, you'll get four "main" partitions on each separate hard-disk, named hda1 through hda4.

You may think C: is hda1, D: is hda2, Linux main is hda3 and Linux swap is hda4. Not necessarily, and most likely not. hda1 through hda4 are "main" partitions, also called primary partitions. C: is definitely such a partition, but not the rest too. Actually, it's a common procedure to set up an "extended" partition as the second primary partition (an extended partition is not really a partition, but a holder for any number of actual partitions); you didn't think we'd end up limited at just four partitions on a hard-disk, did you? No, this trick allows us to have an (almost) unlimited number.

So, the other three partitions are actually "virtual" partitions inside the second primary partition (hda2). There are no other "main" partitions (no hda3 and hda4). What are the virtual ones called then? Simple: they are assigned numbers from 5 on, in ascending order, as they are placed on disk. So D: is actually hda5, Linux main is hda6, and swap is hda7. There you go.

Of course, maybe you didn't set your partitions up like this. In any case, the rules still apply.

6.4 The LILO 1024 cylinder warning

After completing Disk Druid you may get a warning saying your root Linux partition is outside of the 1024 range. What it means is the program that usually loads Linux at boot time, called LILO, can't function if the Linux partition is too far away from the beginning of the disk. Well, I don't use LILO anyway, so I don't care about this. Tough luck.

6.5 Some more general options

Some more things will take place next.

The two (or more) Linux partitions will be checked and formatted. You'll also need to specify some configuration options for LILO (use the defaults, it doesn't matter).

Next you'll have to pick up a hostname for your computer. Something to identify it by. I use "xxx". You can use "shockspace", "undertaker", "gonzo" or whatever you want. It's case insensitive. It won't matter once you actually connect to a network (by dial-up or LAN) since you'll be assigned a certain (different) name.

Don't set any firewall. You'll need one, yes, but it's better you set it up manually, setting it up here it's more trouble than it's worth.

Chose your mouse type. I for one have a three button serial mouse on COM1, so I go with "generic 3 button serial mouse". You may have two buttons, or a PS/2 mouse instead of serial; if you have a scroll wheel and it clicks it counts as a third button. If it is serial, make sure you specify COM1 (ttyS0) when asked where it's plugged in. You'll also notice a checkbox called "emulate three buttons"; it means that two button mice can emulate clicking the third button by clicking the two existent buttons at the same time.

Choose some languages to install. I only use English. These languages will be used all around the system, in applications and logs for example, of you choose to. I don't really think anything except English is appropriate (however good, the other translations are just weird, unfamiliar, and can lead to confusion), so I stick to it alone.

Set up your clock next. Just parse the list and choose your country capital or state.

An important step comes next, choosing a root password. The "root" user is the superuser, the one that can do anything it wants on the system. You must have at least the root user set up, so go ahead and pick a (good) password. You'll also be asked to create other users, and you should, just not now. We'll do it later.

The authentication config is important, the default has MD5 and Shadow passwords checked, leave it at that. It means that the file where the user passwords are stored will be protected by first encrypting passwords with MD5, and second by actually using a separate, more protected file to actually store passwords, a so called "shadow", while leaving the main file just so applications know what users exist.

6.6 Package selection

You're in for some really fun stuff next. Since you said you want a "custom system" earlier, you'll get a chance to go through all the individual packages available and select what you need only.

The main selection screen will present you with ready-made categories (such as "printing") which imply a certain selection of packages. The easiest way to go about it is to UNCHECK them all; check "select individual packages" below; and press OK.

Now you'll see another list, with one-level expandable categories, and a big list of actual packages. Go through all of it and below I'll tell you which packages to install. (Keep in mind however that I am setting up a system for my own needs, as I mentioned at the beginning of this page.) OK, here we go:

Amusement/Games
nothing
Amusement/Graphics
nothing
Applications/Archiving
unarj - tool for unpacking ARJ archives
unzip, zip - create and unpack ZIP archives
Applications/Communications
nothing (for now)
Applications/Databases
nothing
Applications/Editors
joe - text-only editor (the one I like best)
Applications/Engineering
nothing
Applications/File
nothing
Applications/Internet
ftp, gftp, ncftp - FTP clients
lynx - text-only Web browser
pine - text-only e-mail client
fetchmail - tool used for fetching messages from multiple POP/IMAP accounts
telnet - tool used to connect to various network services in raw mode
traceroute - tool used for detecting computers onthe network between yours and another one
wget - utility used for fetching files from FTP/Web sites
whois - utility which fetches useful information about other computers or sites on the network
Applications/Multimedia
cdp - CD player
sndconfig - sound configuration utility
Applications/Productivity
nothing
Applications/Publishing
ghostscript - a font management system
ghostscript-fonts - fonts for ghostscript
gv, xpdf - PDF and other formats viewers
Applications/System
control-panel - tool used for running certain configuration utilities
gnorpm - a graphical tool for managing the Red Hat packages (RPM's)
gtop - graphical tool which shows system resources status
mkxauth - utility needed by the X Windows System
symlinks - tools for using file symbolic links
vlock - tool for locking the screen when you go to the bathroom
Applications/Text
unix2dos, dos2unix - text file converters (because of the different line terminations)
Development/Debuggers
nothing
Development/Languages
cpp, dev86, gcc, gcc-c++ - C/C++ compilers
Development/Libraries
nothing
Development/System
nothing
Development/Tools
make, pmake - configuration tools for install kits based on C/C++
patch - tool for updating install kits
Documentation
nothing (for me, you may want something)
System Environment/Base
chkfontpath - utility used by X Windows to manage its font directories
System Environment/Daemons
LPRng - the printing application
XFree86-xfs - the X Windows font server
esound - the sound daemon
iputils - some useful network utilities, such as ping
printconf, printconf-gui - tool for setting up printers
xinetd - a daemon which is used to automatically start up other daemons
System Environment/Kernel
nothing
System Environment/Libraries
nothing
System Environment/Shells
mc - Midnight Commander, a Norton Commander look-alike with Linux capabilities
User Interface/Desktops
control-center - kinda' like the Windows Control Panel; it's only good for interface setup, really
User Interface/X
Xfree86 - the actual X Windows System
Xfree86-100dpi-fonts, Xfree86-75dpi-fonts, Xfree86-ISO8859-2-100dpi-fonts, Xfree86-ISO8859-2-75dpi-fonts, Xfree86-ISO8859-2-Type1-fonts, ttfonts, urw-fonts - various font packages
Xfree86-xf86cfg - an X Windows configuration tool
rxvt - a graphical text terminal (like the command prompt in Windows)
Xfree86-twm, Xfree86-xdm - X display managers
xinitrc - tool which allows each user to customize their X settings
User Interface/X Hardware Support
Xconfigurator - X configuration tool supplied by Red Hat

There are a LOT of packages in the Red Hat distribution and you made it off with just a few; you may think you're done. Thruth is the Red Hat packages (RPM's) have an interdependance system which tells them if they need another package to work (for example, an application written in Tcl/Tk will also need Tcl/Tk installed). So after you've selected the above packages and hit OK, the install program will check dependencies and will most likely find out you need some additional packages installed. It will be kind to you and present you with a lst, so you can choose to install whatever else is needed and get it over with. This could happen two or three times, since the additional packages may need additional packages.

There are also some crucial packages that must be installed no matter what, and you won't be given a chance to choose as far as they are concerned.

Doing it this way you can get a minimal installation of about 500 MB. However, keep in mind we didn't yet install Internet utilities like Netscape, or a fully functional X Windows System, because I intend to use newer packages, which are not included in the distribution. Installing them from the CD would take your installation up to maybe 800 MB. Now you understand why you need at least 1 GB.

6.7 Preparing the system

You'll be presented with a video card which the install program has detected. Right or wrong, just accept it for now.

The actual installation begins, there will be roughly 230 packages installed in 550 MB, over about 5 minutes. Sometime during the installation you'll be asked to put the second CD in.

6.8 Important! The boot disk

Due to that LILO problem we discussed earlier, you won't be able to use LILO to boot into Linux. So first of all ignore the error/warning message you get about this, and then DO ACCEPT the install program to make you a boot floppy-disk which you'll need if you ever wanna actually start Linux. Just make sure it's a good disk, no damage and stuff.

6.9 Setting up X Windows

Linux is not all command line, it has a Windows of its own, called X Windows. The final part of the install process will try to set up a working configuration for it. It doesn't really matter if you suceed or not, since even if you do set up the graphical capabilities right, the package selection I did earlier has left you with a non-working X Windows system <grin>. Enter here to get it working.

7 You're done!

The install program will reboot the computer when you're done. Make sure you have the boot disk in the floppy-drive and boot from it instead of the hard drive. You'll see Linux starting up and after some delightful screenfuls of messages you'll find yourself sitting in from of a screen saying "login >". Type in user "root" and whatever password you chose for yourself and you're in control!

If you don't know what to do next, read some other articles on this site or look for documentation of your own. Important thing is that you have a working Linux installed on your computer.

(OK, so I don't let you completely hanging: type "reboot [ENTER]" to reboot the computer or "halt [ENTER]" to shut it down.

Important! NEVER just turn off the computer once Linux has started! Use commands like reboot or halt to stop it, or if you don't have root prompt press Control-Alt-Del to reboot. Just like Windows, simply stopping the computer without proper shutdown can damage the file systems! (the ones on the Linux partitions.) The latest Linux distributions have switched to journaled filesystems like ext3 which don't take damage in case of improper shutdown. There are still things that could go wrong, so better use the standard approach towards power-off.

< Back to the top | Read other columns | Choose what column I should write next! >