If you don't want to, or can't, use the procedure to install Red Hat Linux from CD, the procedures in this section give you alternatives. The first procedure tells how to install Red Hat Linux from alternative media (using FTP, HTTP, NFS, or hard disk installs). The next procedure describes how to do kickstart installations.
Your CD-ROM drive may not be working, you may not have a CD-ROM drive, or maybe you just want to install a new version of Red Hat Linux that is available from another computer on the network. In any of these cases, Red Hat will let you install Linux from a Web server (HTTP), an FTP server, a shared NFS directory, or local hard disk.
To use HTTP, FTP, or NFS installations, your computer must be connected to a LAN that can reach the computer containing the Red Hat Linux distribution. You cannot use a direct dial-up connection. For a local hard disk install, the distribution must have been copied to a local disk that is not being used for installation. See the section "Setting up an HTTP, FTP, or NFS install server" for details on copying the distribution and making it available.
To begin any of these types of installation, you need to boot the installation process from a floppy disk. Refer to the section on creating boot disks later in this chapter. You also need to know the location of an install server — a Red Hat Linux system on your network that has the Red Hat Linux distribution available.
With the boot disk in hand (bootdisk.img and possibly drvnet.img for network install, or pcmciadd.img for a laptop install), start installation for these install types as follows:
With this version of Red Hat Linux, you can also use CD #1 that comes with this book to start a network or hard disk install. Instead of using a floppy disk, as described below, you can insert Red Hat Linux installation CD #1, reboot the computer, then type linux askmethod. You can then proceed with the steps shown below.
Insert the floppy boot disk.
Reboot the computer.???You should see the "Welcome to Red Hat" boot screen.
Press Enter.???You are prompted to select a language.
Select the language.???You are prompted to choose a keyboard type.
Select your keyboard type.???You are prompted to select an installation method.
Choose the installation method.???Select any of the following installation methods: NFS image, FTP, HTTP, or Hard drive.
Configure the network card.???For any of the network installs, you are asked to select your Ethernet card from the list shown. (This may be detected automatically.) If your card is not on the list, you need to create a floppy from the drvnet.img file, containing drivers for other network cards. (To use the drvnet.img file, press F2, insert the floppy containing the image, and click OK. Choose your card from the list and click OK again.)
Configure TCP/IP.???For any of the network install types (NFS, FTP, and HTTP), you are prompted to configure TCP/IP for your computer. (See the section on configuring networking earlier in this chapter for information on how to add to these fields.)
Identify the location of the Red Hat Linux distribution.???You must identify the NFS server name, FTP site name, or Web site name that contains the Red Hat directory that holds the distribution. Or, if you are installing from hard disk, you must identify the partition containing the distribution and the directory that actually contains the Red Hat directory.
For an FTP install, if you are not downloading from an anonymous FTP site, you must select "Use non-anonymous FTP" when you identify the server and directory. You will need a user name and password that has access to the shared directory.
Do a checksum.???You are asked if you want to do a checksum on the first disk image (.iso file of the first installation CD) found in that directory. Select Test if you do. This will verify that the image is not corrupted before you begin. Repeat this for each disk image.
Continue with installation.???If the distribution is found in the location you indicated, continue the installation as described in the previous section. The install is text-based.
The next section describes how to set up your own server for installing Red Hat Linux.
If you have a LAN connection from your computer to a computer that has about 2.5GB of disk space and offers NFS, FTP, or Web services, you can install Red Hat Linux from that server. Likewise, you can install from a spare disk partition by using a hard disk install. The following procedures let you set up a Linux install server by either copying all files from the three CDs or by copying images of the three CDs.
To do an FTP or HTTP install, you must copy the files from the installation CDs to a directory that you make available to the network. Because there are three installation CDs in the Red Hat Linux distribution, you can't just identify the location of a mounted CD. You must install the contents of all three CDs in the same directory structure on the server's hard disk. For example, you could do the following:
# mkdir /tmp/rh # mount /mnt/cdrom With first CD inserted # cp -r /mnt/cdrom/* /tmp/rh/ # umount /mnt/cdrom ; eject /mnt/cdrom # mount /mnt/cdrom With second CD inserted # cp -r /mnt/cdrom/* /tmp/rh/ # umount /mnt/cdrom ; eject /mnt/cdrom # mount /mnt/cdrom With third CD inserted # cp -r /mnt/cdrom/* /tmp/rh/
Just type y when it asks to overwrite some files. The distribution directory must contain at least the RPMS and base directories, which must include all necessary software packages. In this example, all files were copied. Setting up an NFS install server requires copying CD images to the shared NFS directory.
Instead of copying all files from the three installation CDs, you can copy the entire images of each of the three disks to your hard disk for NFS or hard disk installs. To do this, insert the first installation CD and type the following:
# mkdir /tmp/rh # dd if=/dev/cdrom of=/tmp/rh/disk1.iso????With first CD inserted # umount /mnt/cdrom ; eject /mnt/cdrom # dd if=/dev/cdrom of=/tmp/rh/disk2.iso????With second CD inserted # umount /mnt/cdrom ; eject /mnt/cdrom # dd if=/dev/cdrom of=/tmp/rh/disk3.iso????With third CD inserted # umount /mnt/cdrom ; eject /mnt/cdrom
Add an entry to the /etc/exports file to share the distribution directory you created. Remember, that for NFS installs, this directory must contain CD ISO images. The following entry would make the directory available in read-only form to any computer:
Next, restart NFS by typing the following as root user:
# /etc/init.d/nfs restart
To set the NFS service to be on permanently (it is off by default), type the following as root:
# chkconfig nfs on
If your computer is configured as a Web server, you need to simply make the distribution directory available. For example, after creating the distribution directory as described above, type the following:
# ln -s /tmp/rh /var/www/html/rh
If your computer were named pine.handsonhistory.com, you would identify the install server as pine.handsonhistory.com and the directory as rh.
If your computer is configured as an FTP server, you need to make the distribution directory available in much the same way you did with the Web server. For example, after creating the distribution directory as described above, type the following:
# ln -s /tmp/rh /var/ftp/pub/rh
If your computer were named pine.handsonhistory.com, you would identify the install server as pine.handsonhistory.com and the directory as pub/rh.
With the ISO images of each CD copied to a disk partition that is not being used for your Red Hat Linux install, you can use the hard disk install. If the ISO images exist in the /tmp/rh directory of the first partition of your IDE hard disk, you could identify the device as /dev/hda1 and the directory holding the images as /tmp/rh.
If you are installing Red Hat Linux on multiple computers, you can save yourself some trouble by preconfiguring the answers to questions asked during installation. The method of automating the installation process is referred to as a kickstart installation.
Based on the information you provide in your ks.cfg file, kickstart will silently go through and install Red Hat Linux without intervention. If this file is not correct, you could easily remove your master boot record and erase everything on your hard disk. Check the ks.cfg file carefully and test it on a noncritical computer before trying it on a computer holding critical data.
The general steps of performing a kickstart installation are as follows:
Create a kickstart file. The kickstart file, named ks.cfg, contains the responses to questions that are fed to the installation process.
Install kickstart file. You have to place the ks.cfg on a floppy disk, on a local hard disk, or in an accessible location on the network.
Start kickstart installation. When you boot the installation procedure, you need to identify the location of the ks.cfg file.
A good way to begin creating your kickstart file is from a sample ks.cfg file. When you install Red Hat Linux, the installation process places a file called anaconda-ks.cfg into the /root directory. You can use this file as the basis for the ks.cfg file that you will use for your kickstart installs.
The particular /root/anaconda-ks.cfg file you get is based on the information you entered during a regular installation (CD, NFS, and so on). Presumably, if you are installing Red Hat Linux on other computers for the same organization, multiple computers may have a lot of the same hardware and configuration information. That makes this a great file for you to start creating your ks.cfg file from.
For further details about how to use kickstart, refer to the Red Hat Linux Configuration Guide. You can get this guide from any Red Hat mirror site. To use a more graphical tool for configuring kickstart, run the redhat-config-kickstart command.
To start, log in as the root user. Then make a copy of the anaconda-ks.cfg file to work on.
# cp anaconda-ks.cfg ks.cfg
Use any text editor to edit the ks.cfg file. Remember that required items should be in order and that any time you omit an item, the user will be prompted for an answer. Entries from a ks.cfg file that was created from a regular CD installation of Red Hat Linux are used as a model for the descriptions below. You should start with your own anaconda-ks.cfg file, and as a result, your file will start out somewhat differently. Commented lines begin with a pound sign (#).
The first line in the ks.cfg file should indicate whether the installation is an upgrade or an install. The install option runs a new installation. You can use the upgrade keyword instead to upgrade an existing system. (For an upgrade, the only requirements are a language, an install method, an install device, a keyboard, and a boot loader.)
The required lang command sets the language (and to be more specific, the country as well) in which Red Hat is installed. The value is U.S. English (en_US.UTF-8) by default.
You can install multiple languages to be supported in Red Hat Linux. Here is an example of the default being set to United States English:
langsupport –default en_US..UTF-8 en_US.UTF-8
The required keyboard command identifies a United States (us) keyboard by default. More than 70 other keyboard types are supported.
The required mouse command identifies the mouse type. The following example shows a generic three-button PS/2 type mouse (generic3ps/2). You could replace it with a two-button serial mouse (generic), a two-button PS/2 mouse (genericps/2), or a Microsoft IntelliMouse (msintellips/2). For a serial mouse, identify the device (for example, --device ttyS0 for the COM1 port). To configure other types of mice, you must run mouseconfig. To see other mouse types, run the mouseconfig --help command.
mouse generic3ps/2 –device psaux
The optional xconfig command can be used to configure your monitor and video card. If you use the skipx command instead (as shown in the following code sample), no X configuration is done. (After the system is installed, run redhat-config-desktop to set up your X configuration.) When you use the xconfig command, you can identify the type of X server to use based on your video card (--card) and monitor specs (--hysnyc and --vsync). A handful of other options enable you to set the color depth in bits (--depth), the screen resolution (--resolution), whether the default desktop is GNOME or KDE (--defaultdesktop), whether the login screen is graphical (--startxonboot), and the amount of RAM on your video card (--videoram). (All the information after xconfig should actually appear on one line.)
skipx or xconfig --card "ATI Mach64 3D Rage IIC" --videoram 2048 --hsync 30-95 --vsync 50-180 --resolution 800x600 --depth 16 --startxonboot defaultdesktop gnome
The optional network command lets you configure your Red Hat system's interface to your network. The example tells your computer to get its IP address and related network information from a DHCP server (--bootproto dhcp). If you want to assign a particular IP address, use the --bootproto static option. Then change the IP address (--ip), netmask (--netmask), IP address of the gateway (--gateway), and IP address of the DNS server (--nameserver) to suit your system. You can also add a hostname (--hostname).
Although the network values appear to be on three lines, all values must be on the same line.
network --bootproto dhcp ???????????or network --device eth0 --bootproto static --ip 192.168.0.1 --netmask 255.255.254.0 --gateway 192.168.0.1 --nameserver 192.168.0.254-–hostname duck.ab.com
The rootpw command sets the password to whatever word follows (in the example, paSSword). It is a security risk to leave this password hanging around, so you should change this password (with the passwd command) after Linux is installed. You also have the option of adding an encrypted password instead (--iscrypted g.UJ.RQeOV3Bg –enablemd5).
rootpw paSSword or rootpw --iscrypted g.UJ.RQeOV3Bg –-enablemd5
The firewall command lets you set the default firewall used by your Red Hat Linux system. The default value is medium (medium security). You can also set firewall to high (high security) or disabled (no firewall). (These values are described in the installation procedure earlier in this chapter.) As you can see in the example, you can optionally indicate that there be no restrictions from host computers on a particular interface (--trust eth0). You can also allow an individual service (--ssh) or a particular port:protocol pair (--port 1234:upd).
firewall --high --trust eth0 --ssh --port 1234:udp firewall --high
The required authconfig command sets the type of authentication used to protect your user passwords. The --enableshadow option enables the /etc/shadow file to store your passwords. The --enablemd5 option enables up to 256 character passwords. (You would typically use both.)
authconfig --enableshadow --enablemd5
The timezone command sets the time zone for your Linux system. The default, shown here, is United States, New York (America/New_York). The –utc option indicates that the computer's hardware clock is set to UTC time. If you don't set a time zone, US/Eastern is used. Run the timeconfig command to see other valid time zones.
timezone --utc America/New_York
The bootloader command sets the location of the boot loader (GRUB, by default). For example, --location=mbr adds GRUB to the master boot record. (Use --location= none to not add GRUB.) You can also add kernel options to be read at boot time using the append option (--append hdd=ide-scsi) or an optional password for GRUB (--password=GRUBpassword).
bootloader --location=mbr password=GRUBpassword
Partitioning is required for a new install, optional for an upgrade. The code that follows is from the sample ks.cfg file. The clearpart --linux value removes existing Linux partitions (or use --all to clear all partitions) on the first hard drive (--drives=hda). The part /boot, / and swap, sets the file system type (--fstype) and partition name (onpart) for each partition assignment. You can also set sizes of the partitions (--size) to however many MB you want.
# The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work #clearpart --linux --drives=hda #part /boot --fstype ext3 --size=100 --ondisk=hda #part / --fstype ext3 --size=700 --grow --ondisk=hda #part swap --size=128 --grow --maxsize=256 --ondisk=hda
To indicate which packages to install, begin a section with the %packages command. (A few examples follow.) Designate whole installation groups, individual groups, or individual packages. After %packages, start an entry with an @ sign for a group of packages, and add each individual package by placing its name on a line by itself. Here is an example:
You can find a listing of package groups and individual packages on the Red Hat installation CD. Find the comps file in the RedHat/base directory. However, if you start with the anaconda-ks.cfg file that resulted from installing Red Hat Linux, you might already have a set of packages that you want to install.
%packages @ Administration Tools @ Authoring and Publishing @ Core @ DNS Name Server @ Development Libraries @ Development Tools . . . @ Web Server @ Windows File Server @ X Window System
The %packages command is not supported for upgrades. To do an Everything install, you can remove the package names shown. Then, after the %packages line, you can add an @ everything line.
The %post command starts the post-installation section. After it, you can add any shell commands you want to run after installation is completed. By default, you should have useradd commands for users you added during installation. You can also use the usermod command to add the user's password.
%post /usr/sbin/useradd jake chfn –f 'John W. Jones' jake /usr/sbin/usermod –p '$1$?r??????$kQUMYbFhOh79wECxnTuaH.' jake
At this point you should have a working ks.cfg file.
Once the ks.cfg file is created, you need to put it somewhere accessible to the computer doing the installation. Typically, you will place the file on a floppy disk. However, you can also put the file on a computer that is reachable on the network or on a hard disk.
To copy the file to a floppy disk, create a DOS floppy and copy the file as follows:
# mcopy ks.cfg a:
When you do the Red Hat Linux kickstart installation, have this floppy disk with you.
Being able to place the ks.cfg file on a computer on the network requires a bit more configuration. The network must have a DHCP or a BOOTP server configured that is set up to provide network information to the new install computer. The NFS server containing the ks.cfg file must export the file so that it is accessible to the computer installing Linux. To use a ks.cfg file from the local hard disk, you can place the file on any partition that is a Windows (VFAT) or Linux (ext3) partition.
If the kickstart file (ks.cfg) has been created and installed in an accessible location, you can start the kickstart installation. Here is an example of how you can do a kickstart installation using the Red Hat Linux CD and a floppy containing a ks.cfg file:
Insert the Red Hat Linux CD and restart the computer.
When you see the boot prompt, insert the floppy containing the ks.cfg file and type the following (quickly, before the installation boots on its own):
boot: linux ks=file:fd0/ks.cfg
You should see messages about formatting the file system and reading the package list. The packages should install, with the only intervention required being to change CDs. Next you should see a post-install message. Finally, you should see the "Complete" message.
Remove the floppy; then press the Spacebar to restart your computer (the CD should eject automatically).
To not have to change CDs with kickstart, do a hard disk or network install. You can install using kickstart over NFS (ks:nfs:server:path), from Web server (ks=http://server/path), or from your hard drive (ks=hd:device).