If you don’t want to, or can’t, use the procedure to install Fedora Core from DVD, the procedures in the following sections give you alternatives. The first subsection describes alternate ways of booting the installation, such as PXE (if your computer doesn’t have a bootable DVD or CD drive).
After the install procedure boots, use the “Installing from other media” section that follows to learn how to install Fedora from media other than DVD or CD-ROM (using FTP, HTTP, NFS, or hard disk installs). If you want to have the installation screens appear on another computer as you install, refer to the “Starting a VNC install” section. The subsection following that describes how to do kickstart installations.
You computer may not have a DVD or CD drive or may have one that is unbootable, so, you need to find an alternative way to boot the install process. Although booting installation from 1.44 floppy disks is no longer supported (the 2.6 kernel won’t fit on one), you have a few other alternatives:
Boot installation from hard disk
Boot from a USB pen drive or other USB device
Do a PXE install
Procedures for starting installation in those two ways are described in the following sections.
Booting the install process is similar to booting a regular Linux system. To start an install from your hard disk all you really need to do is:
Put the files needed to boot installation on your hard disk.
Configure your boot loader to tell your computer’s master boot record about those installation files.
This procedure presumes that there is already a Fedora or Red Hat Linux system running on the system (so you are doing an upgrade or a fresh install of Fedora). It also presumes that you can find a way to get those files on to the hard disk (I’ll describe how to do that from a DVD or CD that can be mounted even if it can’t be booted).
See the section earlier in this chapter on setting up install servers, since presumably you need the contents of the Fedora installation DVD accessible from somewhere other than the DVD itself.
Insert the Fedora Core 3 DVD into the DVD drive while Fedora or Red Hat Linux is running.
If the DVD isn’t automatically mounted, as root user type the following to mount it:
# mount /media/cdrecorder
Copy the vmlinuz and initrd files from the installation DVD to your boot directory:
# cd /media/cdrecorder/isolinux # cp initrd.img /boot/initrd-boot.img # cp vmlinuz /boot/vmlinuz-boot
If you are not able to mount a DVD or CD on the machine, you could copy the files from another machine on the network using scp. Or you could download those files to your /boot directory from a Fedora FTP site that contains the Fedora distribution.
Change your local /boot/grub/grub.conf file to include an entry for the vmlinux and initrd files you just added to your boot directory. For example:
title Fedora Core 3 installation root (hd0,0) kernel /vmlinuz-boot initrd /initrd-boot.img
This example assumes that your /boot partition exists on the first partition of your first IDE hard drive (hd0,0 which is /dev/hda1). You could type df to see where your /boot partition is located.
Reboot your computer.
When the GRUB boot screen appears, press the down arrow key to move to the entry that we titled “Fedora Core 3 installation” and press Enter. From here you should be able to start installation normally.
Some newer computer motherboards can boot from USB devices, allowing you to copy boot disk images to something like a USB pen drive to start the installation. To add the software needed to boot a pen drive or other USB device to start the Fedora install process, you can do the following:
Insert the Fedora Core 3 DVD into the DVD drive while Fedora or Red Hat Linux is running. The DVD should be automatically mounted in the /media directory.
If the DVD isn’t automatically mounted, as root user type the following to mount it:
# mount /media/cdrecorder
If you don't know the mount point directory for your DVD or CD drive, check the /etc/fstab file to see if it's listed there. If it's not listed, create your own mount point.
Insert the pen drive or other USB storage device into a USB port. The device should be automatically mounted under the /media directory under a name such as usbdisk.
Write the diskboot.img image from the DVD to the bootable USB drive. (This image only needs about 6MB of disk space.) For example, if the device of the USB pen drive were /dev/sda1, you would type
# dd if=/media/cdrecorder/images/diskboot.img of=/dev/sda1
To start the installation process from the USB drive you just copied the image to, remove the USB drive and insert it into the computer where you want to install Fedora Core. Then reboot that computer. It should boot to the Fedora installation boot screen.
If the installation boot screen doesn't appear, your computer may not be set to boot USB devices. Go into setup mode when the computer first boots and try to change the boot order in the computer BIOS so that USB devices are booted first.
If the installation boot screen does appear, you will use the linux askmethod way of installing. Refer to the "Installing from other media" section later in this chapter for information on how to proceed.
Another method to begin Fedora installation is to use Pre-eXecution Environment (PXE). With PXE, the installation process begins by setting the BIOS of your computer to look on the network for a PXE server to boot from. For information on how to do a PXE install, refer to /usr/share/doc/syslinux-*/pxelinux.doc. For the PXE install server, you can use the kernel and initrd images from the images/pxeboot directory on the first Fedora DVD. You need to be able to set up a DHCP server and Tftp server to complete this procedure.
Once the installation process has booted (from DVD, CD or as described in the previous section), Fedora will let you get the actual packages that are to be installed 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 Fedora 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.
You can use the DVD that comes with this book (or an alternative method described in the previous section) to start a network or hard disk install.
For earlier Red Hat and Fedora Core distributions, you could use a floppy disk to boot the install process. Because the 2.6 kernel it too large to fit on a floppy disk, however, this method of starting installation is not supported for Fedora Core 2 or later versions.
Insert the Fedora installation DVD into the DVD drive.
Reboot the computer. You should see the Fedora boot screen.
Start askmethod. Type the following at the boot prompt:
boot: linux askmethod
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: Local CDROM, 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 obtain a driver disk that contains the driver needed by your network card.
The Fedora project does not currently offer a driver disk, so you need to obtain the appropriate driver on your own.
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 Fedora distribution. You must identify the NFS server name, FTP site name, or Web site name that contains the Fedora 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 Fedora directory.
For an FTP install, if you are not downloading from an anonymous FTP site, you must select the “Use non-anonymous FTP” check box 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 installation disk) 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 Fedora.
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 Fedora 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 DVD or four installation CDs or by copying images of the DVD or four installation CDs.
To do an FTP or HTTP install, you must copy the files from the installation DVD to a directory that you make available to the network. For example, you could do the following:
# mkdir /tmp/rh # mount /media/cdrecorder With DVD inserted # cp -r /media/cdrecorder/* /tmp/rh/ # umount /media/cdrecorder ; eject /media/cdrecorder
You could, instead, set up an install server using the Fedora installation CDs, if you have them available. Because there are four installation CDs in the current Fedora distribution, you can’t just identify the location of a mounted CD. You must install the contents of all the CDs in the same directory structure on the server’s hard disk. For example, you could do the following:
# mkdir /tmp/rh # mount /media/cdrecord With first CD inserted # cp -r /media/cdrecord/* /tmp/rh/ # umount /media/cdrecord ; eject /media/cdrecord # mount /media/cdrecord With second CD inserted # cp -r /media/cdrecord/* /tmp/rh/ # umount /media/cdrecord ; eject /media/cdrecord # mount /media/cdrecord With third CD inserted # cp -r /media/cdrecord/* /tmp/rh/ # umount /media/cdrecord ; eject /media/cdrecord # mount /media/cdrecord With fourth CD inserted # cp -r /media/cdrecord/* /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 or hard disk install requires copying DVD or CD images to the shared NFS directory.
Instead of copying all files from the installation DVD or CDs, you can copy the entire DVD image (or all four CD images) to your hard disk for NFS or hard disk installs. To install the DVD, do the following:
# mkdir /tmp/rh # dd if=/dev/cdrom of=/tmp/rh/disk1.iso With DVD inserted # umount /media/cdrecord ; eject /media/cdrecord
To use images from the four Fedora installation CDs instead, type the following:
# mkdir /tmp/rh # dd if=/dev/cdrom of=/tmp/rh/disk1.iso With first CD inserted # umount /media/cdrecord ; eject /media/cdrecord # dd if=/dev/cdrom of=/tmp/rh/disk2.iso With second CD inserted # umount /media/cdrecord ; eject /media/cdrecord # dd if=/dev/cdrom of=/tmp/rh/disk3.iso With third CD inserted # umount /media/cdrecord ; eject /media/cdrecord # dd if=/dev/cdrom of=/tmp/rh/disk3.iso With fourth CD inserted # umount /media/cdrecord ; eject /media/cdrecord
Add an entry to the /etc/exports file to share the distribution directory you created. Remember, that for NFS installs, this directory must contain DVD ISO image or CD ISO images. The following entry makes 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, with just the iso image (or images) in the current directory, you could type the following:
# mkdir /var/www/html/rh/ # cp *.iso /var/www/html/rh
Then simply start the Web server as you would normally (service httpd start). 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 the DVD or each CD copied to a disk partition that is not being used for your Fedora Core 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.
The VNC Fedora installation type doesn't exactly fit into the other installation categories, but I'm adding it here because you might find it useful. With a VNC install, you can boot up the installation process on the machine you want to install Fedora to, then step through the installation screens on another computer (running a VNC server). This can be convenient if you want to sit at your own desk while you install Fedora on a computer down the hall. Here's what to do:
Go the computer from which you want to view the install process (in our example, the one with IP address 10.0.0.1) and start a VNC client process by typing the following from a Terminal window:
# vncviewer -listen
From the computer you want to install Fedora Core to, insert the installation DVD or first CD and reboot the computer. The Fedora Core installation boot screen should appear.
Start the VNC install procedure by identifying the computer screen you want to watch the install from. You should also enter a password (at least six characters). For example, to have the install screens appear on the computer at IP address 10.0.0.1, type the following at the Fedora Core installation boot prompt:
linux vnc vncconnect=10.0.0.1 vncpassword=myF3pass
Answer the first few questions as you would for a normal Fedora Core install from DVD or CD: Media check, Choose a Language, and Keyboard Type. Next you're asked if you want to configure TCP/IP.
Choose either dynamic IP configuration (if you have a BOOTP or DHCP server configured on your network) or enter your own IP address, Netmask, Default gateway and Primary nameserver for the local computer. Select OK to continue. If the network connection starts up successfully, you will see messages such as the following:
Starting VNC... The VNC server is now running Attempting to connect to vnc client on host 10.0.0.1... Connected! Starting graphical installation...
Return to the desktop where you are going to view the install procedure. A VNC window should appear on the desktop, containing the Fedora Core Welcome screen. Proceed with installation as you would normally.
If you are not able to connect to the vncviewer, make sure that port 5500 is open and accepting connections on your desktop system. Check the descriptions of iptables in Chapter 14 for further information on opening ports in your firewall.
If you are installing Fedora 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 Fedora 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, CD, 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 Fedora Core, 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 Fedora 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 system-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 Fedora 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 method of installation is indicated on the next line. Possible locations for the installation media include: NFS (nfs --server=servername --dir=installdir), FTP (url url ftp://user:passwd@server/dir), HTTP (url --url http://server/dir), or hard drive (harddrive --dir=/dir partition=/dev/partition). For the default DVD or CD install, you will see:
The required lang command sets the language (and to be more specific, the country as well) in which Fedora is installed. The value is U.S. English (en_US.UTF-8) by default.
You can install multiple languages to be supported in Fedora. Here is an example of the default being set to U. S. 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 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 system-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 Fedora 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 --device eth0 --bootproto dhcp or network --device=eth0 --bootproto=static --ip=192.168.0.1 --netmask=255.255.255.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 following 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 Fedora system. The default value is enabled (if the firewall is turned on). You can also set firewall to 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 --enabled --trust=eth0 --ssh --port=1234:udp
The selinux command indicates whether or not Security Enhanced Linux is enabled. The following line shows it as disabled:
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. On the %packages line, you can indicate whether or not to resolve dependencies by installing those packages needed by the ones you selected (--resolvedeps). 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 Fedora installation DVD or CD #1. Find the comps file in the Fedora/base directory. However, if you start with the anaconda- ks.cfg file that resulted from installing Fedora, you might already have a set of packages that you want to install.
%packages --resolvdeps @ 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 Fedora kickstart installation, have this floppy disk with you. As an alternative, you can copy the ks.cfg file to a CD.
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 Fedora DVD and a floppy containing a ks.cfg file:
Insert the Fedora DVD or first 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 DVD or CD should eject automatically).
To avoid having 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).