Quick HOWTO: Ch25: Network-Based Linux Installation: Basic Preparation
Quick HOWTO: Ch25: Network-Based Linux Installation: Basic Preparation
Linux Installation
From Linux Home Networking
Introduction
Fedora Linux allows you to do operating system installations via a network connection using a
Kickstart server. It is frequently much faster than using CDs and the process can be automated.
The procedure is fairly simple:
Connect the new server (installation client) to the same network as the server with the
pre-loaded installation files (installation server).
Boot the installation client from a specially created boot CD
Enter your preferred installation method (FTP, HTTP, NFS) and the needed network
parameters to do this
The installation procedure will then continue with the more familiar Fedora Linux
installation screens. Enter your selections and then complete the installation.
This chapter will briefly explain how to set this up using all three methods using a single
installation server (bigboy) with an IP address of 192.168.1.100.
Basic Preparation
In this example we are going to set up a kickstart server that will be used in Fedora Core
installations. All the necessary files will be placed in the /data/network-install directory.
You now need to place the network installation driver files into the base directory.
The HTTP, NFS and FTP kickstart methods all require the base set of Fedora files to be installed
on the kickstart server. Here's how to do it:
3) Copy the files from the CD ROM base directory to the hard disk
4) Unmount your CD ROM and use the eject command to retrieve it from the drive bay.
5) Repeat steps 2 to 4 with all your CDROMs. Overwrite files when prompted.
Note: Note: You also have the option to FTP all the files of the desired version of Fedora from
the Fedora website to the /data/network-install/RPM directory.
NFS Preparation
Create ISO images of the installation CDs and place them in the /data/network-install/ISO
directory. This will require about 3-5 GB of space as well. You can download the ISO images
from the Fedora website or use the Fedora CDs as shown below. If you create the ISOs files
from CDs, make sure they have the same file names as the ones you can download from the
Fedora Web site.
Follow these steps for each CD, substituting the filename where necessary:
Note: Here is a sample procedure to make ISO files with the older mkisofs command. You may
have to install the mkisofs RPM on newer Fedora versions. The command requires a mounted
CDROM drive, so don't forget the mount command.
NameVirtualHost 192.168.1.100
#
# For HTTP Installations
#
<VirtualHost 192.168.1.100>
ServerName 192.168.1.100
DocumentRoot /data/
</VirtualHost>
<Directory /data/network-install>
Options +Indexes
AllowOverride AuthConfig
order allow,deny
allow from all
</Directory>
#
# File: vsftpd.conf
#
#
# Anonymous FTP Root Directory
#
anon_root=/data/network-install/RPM
#
# Log file definition
#
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
1) Create a /etc/exports file with the following entry in it. You must use tabs, not spaces between
the entries
/data/network-install *(ro,sync)
2) Make sure that the rpcbind (portmap on older versions of Linux) , nfs, nfslock and netfs
daemons are all running to create an NFS server. The startup scripts for these are found in the
/etc/init.d directory. Chapter 29, "Remote Disk Access with NFS", will explain this in more
detail.
3) Run the exportfs command to add this directory to the NFS database of network available
directories.
4) The installation client must have a matching pair of forward and reverse DNS entries on your
DNS server. In other words, a DNS lookup on the IP address of the installation client must return
a server name that will map back to the original IP address when a DNS lookup is done on that
same server name.
This may mean that you will have to create entries for all your DHCP IP addresses if you choose
to use a DHCP method of assigning IP addresses during installation.
Setting up the Installation Server as a DHCP server is fairly straight forward and can be found in
Chapter 8, "Configuring the DHCP Server".
1. Your RPM directory should have a subdirectory named images in it. There will be a file there
named boot.iso which is used in booting your system when installing Linux from DVD or CD.
Fedora mirror sites that have directory structures similar to that of the DVD also have a boot.iso
file located in the <fedora-version>/Fedora/i386/os/images/ directory. This file is different in
both size and function to that on your DVD. It usually larger than 10 MB in size and it is the boot
file you need for kickstart. Download the boot.iso file from your favorite mirror site using a
utility like wget.
2. You will now need the device name of your CDROM device. This can be obtained using the
wodim command. In this case it is called /dev/scd0.
3. Insert a blank CD. The wodim command can now be used again to burn the boot.iso ISO
image file to the CD.
Keep the CD. You will soon need it for your kickstart client machine.
Local CDROM
Hard Drive
NFS Image
FTP
HTTP
During the installation, issue the following command on the server to check the Apache logs. It
will help to verify whether the kickstart client is accessing the files correctly. You should get a
status code of 200<code> after each GET statement. You should retrace your steps
if you are not.
The "Red Hat directory" will be "/". The following menus will be text based versions of
the usual Fedora installation screens.
The "Red Hat directory" will be "/data/network-install/RPM". Enter the username and
password of your special FTP user account. The following menus will be text based
versions of the usual RedHat installation screens.
Note: During the installation, issue the following command on the server to check the FTP logs.
It will help to verify whether the kickstart client is accessing the files correctly.
This section shows you how to automate network installations using the kickstart application and
NFS. You can use HTTP and FTP but they have been omitted to keep the discussion brief.
You may want to then edit the configuration file and comment out certain parameters that may
change from system to system with a "#". These could include things like the system's name and
IP address. During the kickstart process you will be prompted for these unspecified values.
Note: Do not change the order of the entries in the kickstart configuration file.
Note: The IP address you assign must be on the same subnet as that of the DHCP server for
kickstart to work. If the server is going to reside on a different network after the installation, then
you'll have to run a separate script to change the IP addressing information after the installation
is complete.
You may want to run some commands on the newly created Linux installation after kickstart is
complete. Some processes that are activated by default by Fedora may not be suitable for your
server and may need to be disabled.
This can be done by placing a %post section at the end of the kicksrart file with all the post
installation commands you wish to run. Here is an example:
%post
chkconfig isdn off
chkconfig pcmcia off
chkconfig portmap off
chkconfig apmd off
chkconfig nfslock off
chkconfig nfs off
It is possible to use the /root/anaconda-ks.cfg file as a template for future installations. RedHat
comments out the partitioning information in this file, so you will either have to uncomment it
and then make your partitioning modifications or be prepared to be prompted for your portioning
information.
Remember that you may want to remove the "#" comments from the partition section of the file.
If not, you will be prompted for this information.
Verify that the first two lines of the file look like this or else you may be prompted for NFS ISO
file location information.
install
nfs --server=192.16.1.100 --dir=/data/network-install/ISO
Verify that the first two lines of the file look like this or else you may be prompted for RPM base
file location information.
install
url --url http://192.168.1.100/network-install/RPM
There are two ways to specify the name of the kickstart file to use. The first is to enter it
manually from the LILO boot: prompt when you insert the boot CD. The second is to have your
DHCP server automatically tell the Kickstart client about the name of the kickstart file to use
when it assigns the IP address. Both methods are listed below:
Once you have booted from your boot CDROM, you'll need to use the following command at the
lilo boot: prompt to continue with the installation. The ks.cfg file is the kickstart configuration
file we want to use.
NFS Method
HTTP Method
boot: linux ks=http://192.168.1.100/network-install/kickstart/ks.cfg
Whenever you have to create lots of cloned Linux servers, then you may want to configure your
DHCP server to specify the single kickstart configuration file you wish to use. Here is how it's
done:
2) Edit your dhcpd.conf file and add the following lines to the section for the interface that will
be serving DHCP IP addresses. The next-server value is the IP address of the kickstart server.
filename "/data/network-install/kickstart/ks.cfg";
next-server 192.168.1.100;
3) Insert the boot CD into the kickstart client Linux box and connect it to the DHCP network. At
the boot: prompt type in the following command:
boot: linux ks
Kickstart will first search for a configuration file named ks.cfg on either the boot CD. It will then
automatically attempt to get a DHCP IP address and see if the DHCP server will specify a
configuration file.
Kickstart will then use NFS to get both the configuration file and the installation ISOs. The rest
should be automatic.
Conclusion
The Kickstart method of Fedora Linux installation can greatly reduce the length of time it takes
to install the operating system. Time is saved not only because a network connection can be
faster than using CDs, but also because it can be left unattended to install a predetermined Linux
configuration. A Kickstart server connected to an isolated wireless network dedicated to the
purpose may be a good idea for data centers with hundreds of Linux servers.
A recent standard called PXE allows you to run kickstart without a CD ROM if you configure
the NIC card to do a network boot from a specially configured DHCP server. The topic is beyond
the scope of this book, but it may be interesting for readers with more complex projects to
research this option more.
=====================================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Installing Red Hat Linux
To begin most installations, insert the first installation CD into the CD drive and turn on or reset
the system. For hard disk and network-based installations, you can use the rescue CD (page 39)
in place of the first installation CD.
The system boots from the CD and displays a screen of instructions with a boot: prompt at the
bottom. Refer to "BIOS setup" on page 25 if the system does not boot from the CD.
You cannot boot from a floppy diskette Because most kernels have grown too large to fit on a
floppy diskette, you cannot boot from a floppy. You cannot fit a standard Fedora Core 2 (and
later) kernel on a floppy diskette. You may be able to fit some Red Hat Enterprise Linux kernels
on a diskette. Fedora gives you the option of booting from a USB pen drive using the
diskboot.img file.
Many newer motherboards come with SATA (Serial ATA) adapters ready for use. If you do not
have SATA devices, the presence of these adapters can dramatically lengthen the time it takes the
system to boot. Before starting the installation, disable SATA adapters in the BIOS. For more
information, refer to "CMOS" on page 25.
Normal installation You can give many different commands at a boot: prompt. If you are
installing from CDs, you can generally press RETURN without entering a command to start
installing Red Hat Linux. Or you can just wait; if you do not type anything for a minute, the
installation proceeds as though you pressed RETURN.
Display problems If you have problems with the display during installation, give the following
command, which turns off video memory, in response to the boot: prompt:
SELinux By default, Fedora is installed with SELinux (page 379) turned off. Unless you need a
very secure system, you do not need to turn this feature on. Give the following command to
install Fedora with SELinux turned on:
When you give this command to install Fedora, the Firewall screen allows you to set up SELinux
(Figure 3-5, page 51).
Non-CD installations If you are installing from other than CDs, that is, if you are installing from
files on the local hard disk or from files on another system using FTP, NFS, or HTTP, give the
following command in response to the boot: prompt:
boot: linux askmethod
Booting As the system boots, text scrolls on the monitor, pausing occasionally. After a while (up
to a few minutes, depending on the speed of the system), the installer displays a graphical or
pseudographical display, depending on the system you are installing and the commands you gave
at the boot: prompt.
The balance of this section covers the commands you can give in response to the boot: prompt.
Unless you are having problems with the installation or have special requirements, you can skip
to the next section, "The Anaconda Installer" on page 46.
Boot Commands
All the commands (except for memtest86) you can give in response to the boot: prompt consist
of the word linux followed by an argument that is passed to the Anaconda installer. Many of the
commands can be combined. For example, to install Linux in text mode using a terminal running
at 115,200 baud, no parity, 8 bits, connected to the first serial device, give the following
command (the ,115200n8 is optional):
The next command installs Red Hat Linux in graphical mode (by default) on a monitor with a
resolution of 1024x768, without probing for any devices. The installation program asks you to
specify the source of the installation data (CD, FTP site, or other).
Following are some of the commands you can give at the boot: prompt. Each command must be
terminated with RETURN.
RETURN Without entering a command, press RETURN in response to the boot: prompt to
perform a graphical installation from CDs. This installation probes the computer to determine as
much as possible about the hardware.
memtest86 FEDORA Calls memtest86 when you boot from a CD only. The GPL-licensed
memtest86 utility is a standalone memory test for x86-based computers. Press C to configure the
test, ESCAPE to exit. See www.memtest86.com for more information.
linux askmethod Gives you a choice of installation sources: local CD or hard drive or over a
network using NFS, FTP, or HTTP.
Local CD Displays the CD Found screen, which allows you to test the installation media (the
same as if you had just pressed RETURN).
Hard drive Prompts for the partition and directory that contains the ISO images of the
installation CDs.
NFS , FTP , or HTTP Displays the Configure TCP/IP screen from which you can select DHCP or
enter the system's IP address, netmask, default gateway (IP), and primary nameserver.
linux lowres Runs the installation program at a resolution of 640x480. See also linux resolution.
linux mem= xxx M Overrides the detected memory size. Replace xxx with the number of
megabytes of RAM in the computer.
linux mediacheck Tests one or more installation CDs using an MD5 sum. This option works with
the CD, DVD, hard drive ISO, and NFS ISO installation methods. For more information, refer to
"Check the CDs" on page 47.
linux nofb no framebuffer Turns off the framebuffer (video memory). Useful when problems
occur when the graphical phase of the installation starts. Particularly useful for systems with
LCD displays.
linux noprobe Disables hardware probing for all devices, including network cards (NICs),
graphics cards, and the monitor. Forces you to select devices from a list. You must know exactly
which cards or chips the system uses when you use this command. Use when probing causes the
installation to hang or otherwise fail. This command allows you to give arguments for each
device driver you specify.
Linux rescue Puts the system in rescue mode; see page 377 for details.
linux resolution= WxH Specifies the resolution of the monitor you are using for a graphical
installation. For example, resolution=1024x768 specifies a monitor with a resolution of 1024 by
768 pixels.
linux selinux FEDORA Enables SELinux (page 379) on the system you are installing. When you
give this command to install Fedora, the Firewall screen allows you to set up SELinux (Figure 3-
5, page 51).
linux skipddc Allows you to configure the monitor manually; see linux noprobe for more
information.
linux text Installs Linux using pseudographical mode. Although the images on the screen appear
to be graphical, they are composed entirely of text characters.
linux vnc FEDORA Installs over a VNC (Virtual Network Computing) remote desktop session.
After providing an IP address, you can control the installation remotely using a VNC client from
a remote computer. You can download the VNC client, which runs on several platforms, from
www.realvnc.com.