Red Hat Linux Installation

Here are some notes on how to install Red Hat Linux version 4.1 on a PC, starting from a CD-ROM. The minimum system you will need is a 386SX PC with 8MB RAM.

A 6-CD set containing several Linux distributions (Slackware, RedHat, GNU), plus images of the main Linux FTP sites, is available from Infomagic for around $25 + shipping.


There is a low-volume mailing list for announcements of updates to Red Hat. To subscribe, send a message to redhat-announce-request@redhat.com containing just the word subscribe in the header.

Updated packages can be downloaded from ftp://ftp.redhat.com/pub/redhat/redhat-4.1/updates/i386/ or one of its mirror sites


Create a boot disk

There are three ways you can boot into Red Hat installation:
  1. On machines with very recent BIOSes, you may be able to boot directly from the CD itself.

  2. You can boot your machine into DOS (or Windows 95 in DOS mode), change to directory 'dosutils' on the CD, and type 'autoboot'

  3. Otherwise, the normal way to start is to make a boot floppy. Insert a formatted 1.44MB floppy disk into drive A and type the following:
        d:                     (or whatever drive letter represents your CD-ROM)
        cd \images
        ..\dosutils\rawrite
        Enter disk image source file name: boot.img
        Enter target diskette drive: a
    
    Then boot your system with this floppy in drive A. You can also create this disk on another Linux system, by using "dd if=boot.img of=/dev/fd0"

    If you are installing to a laptop using a PCMCIA peripheral (e.g. PCMCIA SCSI or PCMCIA ethernet card) you will also require a supplementary floppy disk, made from supp.img in the same way.

Make space for a Linux partition

If you want to install Linux alongside your current operating system, you will need to run FIPS to make space for new partitions. This is not necessary if the machine will be dedicated to Linux and you don't mind erasing whatever is currently on the hard disk.

Boot up from the Linux disk

Insert the BOOT disk and reboot your computer. At the boot: prompt hit enter. The kernel will then load from the disk and try to find the hardware in your system; the remainder of the floppy is copied into a RAM disk to run the install program itself.

You will then enter the menu-driven install procedure, which is very straightforward to follow. Use TAB or SHIFT-TAB to move between areas on the screen, and hit ENTER to select an option. Use cursor up and cursor down to select between items in a list. To select or deselect an item with a checkbox [ ] hit the space bar.

Set up partitions

After selecting some basic options (such as what type of screen you have, whether you are using PCMCIA, and what type of media you are installing from), you will be asked whether you want to partition disks. The screen will show a scrolling box containing the names of the drive(s) which Linux has found on your system - for example /dev/hda for the first IDE hard drive, or /dev/sda for the first SCSI hard drive. To partition a drive, make sure it is selected in the list, then select the EDIT button.

This will put you into the fdisk program; see the sample session for details of how to use it. Make sure you create at least one swap partition and one Linux partition.

After leaving fdisk

If you have correctly tagged your swap partition with the type code 82 (so fdisk shows it as "Linux swap"), this will be detected and you will be asked if you want to use it for swap. You should accept.

Next you will be asked which partition you want to use for your root Linux partition. Select it and hit OK. If there are other (non-swap) partitions on your hard disk, you will be given the option to give mount points for them so they will be automatically mounted on system bootup - for example, if you have a windows partition it could be mounted under /windows

You will then be asked which partition(s) to initialise. This is the equivalent of a DOS "format c:" - it erases all files and creates a fresh, ext2 (Linux) filesystem. You should enable this for all your Linux partitions. If this is a brand new disk, it's a good idea to turn on the bad block check - this makes the initialisation rather slower though.

Installation

At this point you can choose which groups of packages you wish to install. I suggest you select "Dialup Workstation" as the default, and also "Web server" and/or "Anonymous FTP/Gopher server" in addition if you wish to provide these services. Also select "C development" if you wish to compile C programs, which includes building your own kernel. Note that if you select "DOS/Windows Connectivity" this will also install the whole X Window System which is rather large.

If you check "Select individual packages" you can then choose the precise set of packages you wish to install. This allows you to add some extra ones now, saving you having to do it later after the system reboots. Here are some I suggest:

For all machines:

joe        (Applications/Editors) - powerful and easy to use editor

For a network server:

bind        (Networking) - name server
imap        (Networking) - POP and IMAP servers
pidentd     (Networking) - identity daemon for keeping track of users
caching-nameserver (System) - config files for bind
getty_ps    (Utilities/System) - for dial-in modem access
ipfwadm     (Utilities/System) - for firewall and IP masquerading config

If you wish to build your own sendmail.cf configurations:

sendmail-cf (Daemons)
pmake       (Development/Building)
m4          (Utilities/Text)

Other useful packages:

fetchmail   (Applications/Mail) - POP client
aout-libs   (Libraries) - if you want to be able to run programs built
                          on old Linux systems
fwhois      (Networking/Utilities) - whois client
traceroute  (Networking/Utilities) - useful for IP debugging
unzip       (Utilities/Archiving) - access .zip archives
zip         (Utilities/Archiving) - create .zip archives
mtools      (Utilities/File) - easy access to MSDOS floppy disks
sharutils   (Utilities/File) - includes uuencode and uudecode
If you wish to build your own kernel, also include 'kernel-source' from Base/Kernel.

Once you hit the final 'OK', the install procedure will run automatically: this includes initialising hard disk partitions and copying in packages.

Configure your System

Once installation is complete, you have a few extra questions to answer: These are mostly self-explanatory, apart from LILO. LILO is necessary to start Linux running, and lets you choose between multiple operating systems at boot time.

There are two places you can install LILO: in the Master Boot Record, or in the Linux partition itself. I suggest you choose as follows:

Booting into Linux and other OSes

When you reboot, you will get a boot: prompt. You can just wait 10 seconds and your system will boot into Linux. Alternatively hit TAB for a list of boot choices, and type one of them in.

After first installing you will only be able to boot into Linux. If you want to be able to choose other operating systems you will need to edit /etc/lilo.conf (e.g. joe /etc/lilo.conf) and add some extra lines at the end:

other=/dev/hda1
	label=win95
	table=/dev/hda
Save this file, then type lilo at the Unix command prompt. This will reinstall LILO and list the choices available. If any errors occur you will be told about them; you need to fix /etc/lilo.conf and run lilo again.

Adding new users

Once you are up and running, you will want to create a normal (unpriviledged) user account for yourself. Since root is an all-powerful account, it is possible to do serious damage by mistyping a command - so it's best to only log in as root when absolutely essential for system administration tasks. To create a new user account, choose a username (up to 8 lower case letters) and enter the following commands:
    adduser fred
    passwd fred
    chfn fred
Use 'finger fred' to see if the information has been set up properly.

Post-install tweaking

As with all distributions, there are likely to be some changes you will want to make to get things running smoothly.

Installing and removing packages

Red Hat's package management system is called rpm. It is very powerful, and although it suffers from a serious overload of command-line switches, its basic operation is very simple. (If you have X installed you can use 'glint' for a graphical interface instead)
rpm -qa             List all installed packages (Query All)
rpm -qi wu-ftpd     Show information about installed package 'wu-ftpd'
rpm -ql wu-ftpd     List all files in installed package 'wu-ftpd'
rpm -qf /home/ftp   Show which package owns the specified file
rpm -e wu-ftpd      Remove (erase) package 'wu-ftpd'
Installable packages have filenames like this:
     <packagename>-<version>-<release>.i386.rpm
Once you have one of these packages, e.g. on a CD-ROM or downloaded from the Internet, it is very easy to install:
rpm -Uvh joe-2.8-7.i386.rpm    Install or update the given package
                               (Update, verbose, show hashes)
Any previous version of the package is uninstalled first. Note that if there is only one file in the current directory beginning with the string 'joe', then you can use 'joe*' instead of the full filename.

When updating, if there is any conflict between an existing configuration file and one in the package being installed, the existing file will be renamed with the extension ".rpmsave" - it is then up to you to resolve the differences between the old and new configuration files. You will also be told if a package "depends" on files in another package, in which case you will have to install the relevant package(s) first.

You can query a package even before you install it, by using commands -qpi and -qpl instead of -qi and -ql:

rpm -qpi joe-2.8-7.i386.rpm    Show information about package
rpm -qpl joe-2.8-7.i386.rpm    Show files contained in package
Finally, it is possible to install packages directly over FTP, simply by giving a URL instead of the filename. For example:
(Anonymous)
rpm -Uvh ftp://ftp.my.domain/pub/contrib/RPMS/squid-1.1.10-1.i386.rpm

(Specific account - will prompt for password)
rpm -Uvh ftp://user@ftp.my.domain/home/user/somefile.rpm
This is best used only when the ftp server is local and you have a high-speed connection. If the package is on the Internet it is almost certainly better to ftp the file first; this gives you the opportunity to restart the transfer if the connection drops.

For more information, see the RPM-Tips and RPM-HOWTO documents.


What to do in an emergency!

It is possible to modify your system in such a way that it hangs during bootup. For example, if you make a bad error in /etc/inittab, and then reboot, your machine could hang when INIT starts up; or if you change the shell for 'root' to a non-existent program, you won't be able to log in as root at all; or you might just forget the root password.

It is possible to use the Red Hat boot disk as a 'rescue' disk, by typing 'rescue' at the boot prompt. It will ask you the usual questions about whether you need PCMCIA or SCSI support, but instead of continuing with the installation program it will drop out to a shell prompt.

Unfortunately the range of commands is very limited at this point. You can mount filesystems, as long as you give the device name without the /dev prefix. (There are no entries in /dev, but the version of mount on the rescue disk can create and use temporary devices under /tmp)

mkdir /c
mount -t ext2 hda1 /c
There is no 'cp' and not even an editor. You can create a floppy disk containing some basic utility programs, mount the disk, and use them. However you can't use editors such as 'joe' or 'vi' because these require display libraries which are not available on the rescue disk. Your best bet is to copy /bin/cp to a floppy disk, and use it to copy the offending file to floppy:
mkdir /a
mount -t msdos /dev/fd0 /a
/a/cp /c/etc/passwd /a
umount /a
Then you can take this disk to another machine, edit the file, and reverse the process to copy it back again. (It's best to edit the file on another Linux machine; DOS editors tend to put CR/LF sequences at the end of each line which will confuse Unix)

This is very awkward and best left to Unix gurus. Slackware is much better in this respect: its 'rescue' disk includes a full set of basic utilities, including 'vi'.


Last updated 10 May 1997