个人工具

“Quick HOWTO : Ch25 : Network-Based Linux Installation”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
Conclusion
 
(未显示1个用户的12个中间版本)
第1行: 第1行:
 
{{From|http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch25_:_Network-Based_Linux_Installation}}
 
{{From|http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch25_:_Network-Based_Linux_Installation}}
 
{{Languages|Quick HOWTO : Ch25 : Network-Based Linux Installation}}
 
{{Languages|Quick HOWTO : Ch25 : Network-Based Linux Installation}}
= 简介 =
+
= Introduction<br> =
  
Fedora Linux可以让你通过网络连接使用kickstart服务器安装操作系统统。这是速度远远超过使用CD并且过程可以自动化。过程是相当简单的:<br>  
+
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:<br>  
  
*连接新的服务器(客户端)到同一网络的预先加载安装文件服务器(安装服务端).
+
*Connect the new server (installation client) to the same network as the server with the pre-loaded installation files (installation server).  
*在客户端用一个专门启动cd开机.
+
*Boot the installation client from a specially created boot CD.  
*选择喜欢的安装方法(FTP,HTTP,NFS)和所需的网络参数.
+
*Enter your preferred installation method (FTP, HTTP, NFS) and the needed network parameters to do this.  
*安装程序然后继续到熟悉的Fedora Linux安装界面上.输入您的选择,后完成安装.
+
*The installation procedure will then continue with the more familiar Fedora Linux installation screens. Enter your selections and then complete the installation.
  
本章将简单介绍一下如何进行这项设定,以及三种安装方法.使用IP地址192.168.1.100的安装服务器(bigboy)
+
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.Fedora Linux
  
= 设立安装服务器 =
+
= Setting Up The Installation Server =
  
kickstart可以配置为FTP,NFS或Apache服务器。下面的解释是每一种方法,但我的经验一直认为,Apache服务器有许多的优点可以超过其他两项。
+
Kickstart can be configured on an FTP, NFS or Apache server. Each method is explained below, but my experience has been that the Apache server has a number of advantages over the other two.<br>
  
使用Web服务器作为kickstart一般较容易,因为:
+
Using a web server for kickstart is generally easier because:<br>
  
*有时,一个kickstart服务器位于远程网络,经常要通过防火墙.严格的防火墙规则比起FTP或NFS,HTTP更容易配置.  
+
*Sometimes a kickstart server has to be located on a remote network, often passing through a firewall. Strict firewall rules for HTTP are generally easier to configure than those for FTP or NFS.  
*对于NFS和FTP,以"http://"为名称所存取档案,对用户来说是较为熟悉的.当您配置文件自动进行kickstart安装这是很重要的. <br>
+
*The http:// nomenclature used by kickstart for accessing files is more familiar to users than that used for NFS and FTP. This may be important for you when configuring files for automated kickstart installation.<br>
  
<br>
+
== Basic Preparation ==
 
+
== 基本准备 ==
+
  
在这个例子中我们要设立一个kickstart服务器,用于 Fedora Core安装.所有必要的文件将被放置在/data/network-install目录.<br>
+
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.  
  
=== 创建安装目录 ===
+
=== Create The Installation Directories ===
  
我们将首先创建目录<code>/data/network-install/RPM</code> 和<code>/data/network-install/ISO</code>,复制必要的文件
+
We'll first create the directories /data/network-install/RPM and /data/network-install/ISO in which we will copy the necessary files
  
 
  [root@bigboy tmp]# mkdir -p /data/network-install/RPM
 
  [root@bigboy tmp]# mkdir -p /data/network-install/RPM
第35行: 第33行:
 
   
 
   
  
你现在需要把网络安装的驱动程序文件复制到相应的目录中.<br>  
+
You now need to place the network installation driver files into the base directory.<br>  
  
=== 复制文件 ===
+
=== Copying The Files ===
  
HTTP,NFS和FTP的kickstart方法,都需要安装文件复制到kickstart服务器.这里这样做:
+
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:<br>
  
1) 为您的CD ROM驱动器创建一个挂载点.  
+
1) Create a mount point for your CD ROM drive.  
  
 
  [root@bigboy tmp]# mkdir /mnt/cdrom
 
  [root@bigboy tmp]# mkdir /mnt/cdrom
 
   
 
   
  
2) 挂载Fedora CD ROM.  
+
2) Mount your first Fedora CD ROM.  
  
 
  [root@bigboy tmp]# mount /dev/cdrom /mnt/cdrom
 
  [root@bigboy tmp]# mount /dev/cdrom /mnt/cdrom
 
   
 
   
  
3) 复制基本文件到硬盘
+
3) Copy the files from the CD ROM base directory to the hard disk
  
 
  [root@bigboy tmp]# cp -r /mnt/cdrom/* /data/network-install/RPM
 
  [root@bigboy tmp]# cp -r /mnt/cdrom/* /data/network-install/RPM
 
   
 
   
  
4) 卸载CD ROM和<code>eject命令<span style="font-family: sans-serif;">弹出光驱</span></code>.  
+
4)Unmount your CD ROM and use the eject command to retrieve it from the drive bay.  
  
 
  [root@bigboy tmp]# umount /dev/cdrom
 
  [root@bigboy tmp]# umount /dev/cdrom
第62行: 第60行:
 
   
 
   
  
5)重复第2-4步复制所有的cd中的文件,复盖文件时会有提示.  
+
5)Repeat steps 2 to 4 with all your CDROMs. Overwrite files when prompted.<br>
  
'''注意''': 你也可以选择从网站FTP下载你需要的文件到<code>/data/network-install/RPM</code>目录.
+
=== HTTP &amp; FTP Preparation  ===
  
=== HTTP &amp; FTP 准备工作  ===
+
Copy all the contents of each installation CD to the /data/network-install/RPM directory. This will require about 3-5 GB of space. When this is completed, your /data/network-install/RPM directory should look like this:  
 
+
复制每个安装CD中的内容到<code>/data/network-install/RPM</code>目录.这将需要约3-5 GB的空间.完成后,<code>/data/network-install/RPM</code>目录看起来应该这样:  
+
  
 
  [root@bigboy tmp]# ls -1 /data/network-install/RPM
 
  [root@bigboy tmp]# ls -1 /data/network-install/RPM
第93行: 第89行:
 
   
 
   
  
=== NFS 准备工作 ===
+
=== NFS Preparation ===
  
创建安装光盘的ISO影像,复制他们到<code>/data/network-install/ISO</code>目录.这将需要约3-5 GB的空间.您也可以从Fedora的网站下载ISO影像或使用Fedora的光盘,如下所示.如果您创建了CD的iso文件,确保他们的文件名和你从Fedora网站下载的一样.  
+
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.<br>
  
请按照下列步骤去操作每个CD:  
+
Follow these steps for each CD, substituting the filename where necessary:  
  
 
  [root@bigboy tmp]# cd /data/network-install/ISO
 
  [root@bigboy tmp]# cd /data/network-install/ISO
第106行: 第102行:
 
   
 
   
  
'''注意:''' 你可以用mkisofs 命令建立iso文件.你也安装新版本的mkisofs RPM.这个命令需要一个加载的cdrom,所以不要忘了mount命令.  
+
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.<br>
  
 
  [root@bigboy ISO]# mount /mnt/cdrom
 
  [root@bigboy ISO]# mount /mnt/cdrom
第113行: 第109行:
 
   
 
   
  
== 设置web服务器 ==
+
== Setup Your Webserver ==
  
现在需要配置Apache,让<code>/data/network-install/RPM</code>/<code>和/data/network-install/ISO目录可以在浏览器上指向为</code>"http: //192.168.1.100/network-install"和"http: //192.168.1.100/network-install/iso".下面的样本就是一个/etc/httpd/conf.d/kickstart.conf的配置.记得要重新启动的Apache ,以使这些设置生效.  
+
You will now have to setup Apache to give the file listings of your /data/network-install/RPM and /data/network-install/ISO directories by pointing your browser to the URL http://192.168.1.100/network-install/RPM/ or http://192.168.1.100/network-install/ISO/ respectively. A sample /etc/httpd/conf.d/kickstart.conf configuration is below. Remember to restart Apache to make these settings take effect.  
  
 
  NameVirtualHost 192.168.1.100
 
  NameVirtualHost 192.168.1.100
第132行: 第128行:
 
     allow from all
 
     allow from all
 
  &lt;/Directory&gt;
 
  &lt;/Directory&gt;
 +
 
   
 
   
  
== 设置 FTP服务器 ==
+
== Setup Your FTP Server ==
  
您也可以设置vsftpd服务器,使用匿名的FTP连接,登录到<code>/data/network-install/RPM</code>目录下。你也需要启用记录。这里是一个vsftpd.conf文件范例片段.记得要重新启动vsftpd,使这些设置生效.  
+
You'll also have to set up your VSFTPD server to make incoming anonymous FTP connections log in to the /data/network-install/RPM directory by default. You will also want to enable the correct logging. Here is a sample snippet of the vsftpd.conf file. Remember to restart VSFTPD to make these settings take effect.  
  
 
  #
 
  #
第156行: 第153行:
 
   
 
   
  
== 创建一个特殊的FTP用户 ==
+
== Create A Special FTP User ==
  
您也可以创建一个特殊用户的非匿名FTP安装,其主目录为"/" .您还必须确保该用户读取/data/network-install目录.看下面的例子.  
+
You can also create a special user for non anonymous FTP installations with its home directory as "/". You must also make sure that the user has read access to the /data/network-install directory. An example is below.  
  
 
  [root@bigboy tmp]# useradd -g users ftpinstall
 
  [root@bigboy tmp]# useradd -g users ftpinstall
第169行: 第166行:
 
  [root@bigbot tmp]# usermod -d / ftpinstall
 
  [root@bigbot tmp]# usermod -d / ftpinstall
 
  [root@bigbot tmp]#
 
  [root@bigbot tmp]#
 +
 +
 
   
 
   
  
== 设置NFS服务器 ==
+
== Setup Your NFS Server ==
  
设置NFS服务器步骤更为复杂.  
+
The steps for setting up an NFS server are more complicated.  
  
1 )&gt;&gt;&gt;&gt;&gt;&gt;创建一个/etc/exports 文件.您必须使用标签./data/network-install *(ro,sync)&gt;&gt;&gt;待核实&gt;&gt;&gt;&gt;<br>  
+
<br>  
  
2) 确认portmap,NFS,nfslock和netfs后台程序正在运行创造NFS服务器.启动脚本在/etc/init.d目录里,可以参考第29章"远程磁盘存取的NFS",会对此进行更详细解释.
+
1) Create a /etc/exports file with the following entry in it. You must use tabs, not spaces between the entries
  
3) 运行exportfs命令来添加这个目录到NFS的目录数据库
+
<br>
 +
<pre>/data/network-install *(ro,sync)</pre>
 +
<br> 2) Make sure that the portmap, 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.
 +
 
 +
<br>
 +
 
 +
3) Run the exportfs command to add this directory to the NFS database of network available directories.
  
 
  [root@bigboy tmp]# exportfs -ra
 
  [root@bigboy tmp]# exportfs -ra
第185行: 第190行:
 
   
 
   
  
4) 安装客户端必须能在DNS服务器有正向和反向的匹配.换言之,查询IP地址,该安装客户端必须返回服务器名,查询名称要能返回ip地址
+
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.
 +
 
 +
<br>
  
 
  [root@bigboy tmp]# host 192.168.1.96
 
  [root@bigboy tmp]# host 192.168.1.96
第197行: 第204行:
 
   
 
   
  
这可能意味着如果你选择DHCP的方式分配ip地址的时候,您要为所有DHCP的IP地址建立entries(报单?)
+
his 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.
  
== 配置DHCP服务器 ==
+
== Configure Your DHCP Server ==
  
在安装过程中,安装客户端会提示您的IP地址应该用在安装过程。我建议选择安装客户端通过DHCP获得地址的选项,这将更自动和快速的安装,它还能减少可能的人为错误.  
+
During the installation procedure, the installation client will prompt you for the IP address it should use for the installation process. I recommend selecting the option that makes the Installation Client get its address via DHCP. This will automate the installation more and will therefore make it faster. It will also reduce the possibility of human error.
 +
 
 +
<br>
 +
 
 +
Setting up the Installation Server as a DHCP server is fairly straight forward and can be found in Chapter 8, "Configuring the DHCP Server".
 +
 
 +
= Creating A Boot CD =
  
设置安装服务器作为一个DHCP服务器是相当简单的.可以参考第8章,"配置DHCP服务器".
 
  
= 建立一个启动CD =
 
  
你需要第一张Fedora CD去工作.你可以复制一个盘,或者用FC2-i386-disc1.iso文件刻录一张.
+
You will also need the first CD in your set of Fedora CDs will work. You can either copy an existing disk, or burn a copy of the FC2-i386-disc1.iso file onto a CD.
  
= 网络安装? =
+
= The Network Installation =
  
从这里,安装程序模仿定期Linux安装,除第一的步骤。From here on, the installation procedure mimics the regular Linux installation, except for the first couple steps.  
+
From here on, the installation procedure mimics the regular Linux installation, except for the first couple steps.<br>
  
1 )连接Linux box客户端到DHCP的网络。
+
1) Connect your client Linux box to the DHCP network.<br>
  
2 )使用第一张Fedora的安装CD启动系统.这是后面网络安装中需要的唯一的CD.<br>  
+
2) Boot your system using the first Fedora installation CD. This is the only CD you'll need for future network installations.<br>  
  
3 )在开机提示输入Linux命令askmethod
+
3) Enter the command "linux askmethod" at the boot: prompt<br>
  
4 )回车
+
4) Hit the &lt;Enter&gt; key<br>
  
5 )通过一般的步骤,直到它会提示"Installation Method"(安装方式),您会看到一个选择:
+
5) Go through the usual steps until it prompts for the "Installation Method". You will see a number of choices<br>
<pre>Local CDROM
+
<pre>Local  
 +
CDROM
 
Hard Drive
 
Hard Drive
 
NFS Image
 
NFS Image
 
FTP
 
FTP
 
HTTP</pre>  
 
HTTP</pre>  
6 )选择你想要的( NFS,FTP,HTTP)  
+
<br> 6) Select the network option of your choice (NFS, FTP, HTTP)<br>
  
7 )选择安装客户端连接到安装服务器的网络以太网设备,这最有可能的接口是"eth0".  
+
7) Select the Ethernet device to which the installation client is connected to the installation server network. This would most likely be interface "eth0".<br>
  
8 )选择"DHCP"接下去在"配置TCP/IP"界面.这使安装客户端在安装过程中使用DHCP.<br>
+
8) Select "DHCP" in the following "Configure TCP/IP" screen. This will make the Installation client use DHCP during the installation.  
  
== 如果你选择NFS方式 ==
+
== If You Selected The NFS Method ==
  
现在,您将达到"NFS setup"菜单.输入安装服务器的IP地址作为"NFS Server Name"(NFS服务器名称). "Red Hat directory"填入"/data/network-install/ISO".接下来就出现惯常的Fedora GUI安装界面.  
+
You will now reach the "NFS setup" menu. Enter the IP address of the installation server as the "NFS Server Name". The "Red Hat directory" will be "/data/network-install/ISO". The following menus will be the usual Fedora GUI installation screens.  
  
== 如果你选择HTTP方式 ==
+
== If You Selected The HTTP Method ==
  
现在,您将达到的"HTTP Setup"(HTTP设置)菜单.提示"Web site name"(网站名称)输入安装服务器的IP地址,"Red Hat directory"填<code>/network-install</code>,接下来就出现惯常的Fedora 文本安装界面.
+
You will now reach the "HTTP Setup" menu. Enter the IP address of the installation server when prompted for a "Web site name".The "Red Hat directory" will be /network-install. The following menus will be text based versions of the usual Fedora installation screens.<br>  
  
在安装过程中,在服务器上发出下列命令检查Apache的日志。这将有助于验证是否kickstart客户端存取的档案是否正确。在GET后面你应得的状态代码为200&lt;code&gt;.如果没有,你应该追溯您的步骤.<code><br></code>
+
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&lt;code&gt; after each GET statement. You should retrace your steps if you are not.  
  
 
  [root@bigboy tmp]# tail -f /var/log/httpd/access_log
 
  [root@bigboy tmp]# tail -f /var/log/httpd/access_log
第247行: 第259行:
 
  192.168.1.247 - - [12/Nov/2006:12:01:05 -0800] "GET /network-install/RPM/repodata/primary.xml.gz HTTP/1.1" '''200''' 844228 "-" "urlgrabber/2.9.9"
 
  192.168.1.247 - - [12/Nov/2006:12:01:05 -0800] "GET /network-install/RPM/repodata/primary.xml.gz HTTP/1.1" '''200''' 844228 "-" "urlgrabber/2.9.9"
 
  192.168.1.247 - - [12/Nov/2006:12:01:19 -0800] "GET /network-install/RPM/repodata/comps.xml HTTP/1.1" '''200''' 853899 "-" "urlgrabber/2.9.9"
 
  192.168.1.247 - - [12/Nov/2006:12:01:19 -0800] "GET /network-install/RPM/repodata/comps.xml HTTP/1.1" '''200''' 853899 "-" "urlgrabber/2.9.9"
 
 
  
== 如果你选择FTP方式 ==
+
== If You Selected The FTP Method ==
  
现在,您将达到"FTP Setup"(FTP设置)菜单.输入安装服务器的IP地址为"FTP Site Name"(FTP站点名).  
+
You will now reach the "FTP Setup" menu. Enter the IP address of the installation server as the "FTP Site Name".<br>
  
*"Not Selecting"(不选择)非匿名FTP选项
+
*"Not Selecting" The Non-Anonymous FTP Box
  
:"Red Hat directory""/". 接下来就出现惯常的Fedora 文本安装界面
+
The "Red Hat directory" will be "/". The following menus will be text based versions of the usual Fedora installation screens.
  
*"Selecting"(选择)非匿名FTP选项
+
*"Selecting" The Non-Anonymous FTP Box
  
:"Red Hat directory""/data/network-install/RPM". 输入定制的ftp用户名和密码接下来就出现惯常的Linux文本安装界面.<br>
+
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.  
  
注意''':''' 在安装过程中,在服务器上发出下列命令检查的FTP日志.这将有助于验证kickstart客户端存取的档案是否正确.  
+
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.  
  
 
  [root@bigboy ~]# tail -f /var/log/vsftpd.log  
 
  [root@bigboy ~]# tail -f /var/log/vsftpd.log  
第269行: 第279行:
 
  Sun Nov 12 20:53:40 2006 2 192.168.1.231 853899 /data/network-install/RPM/repodata/comps.xml b _ o r ftp-install ftp 0 * c
 
  Sun Nov 12 20:53:40 2006 2 192.168.1.231 853899 /data/network-install/RPM/repodata/comps.xml b _ o r ftp-install ftp 0 * c
  
= 网络安装疑难解答 =
+
= Troubleshooting The Network Installation =
 +
 
 +
 
  
你可以进入各种安装状态界面做一些基本的故障排除。<br>
+
You can do some basic troubleshooting by accessing the various installation status screens available.<br>  
  
*随时看安装日志按 &lt;CTRL-ALT-F3&gt;  
+
*The installation logs can always be viewed by hitting &lt;CTRL-ALT-F3&gt;  
*看内核的讯息按 &lt;CTRL-ALT-F4&gt;  
+
*Kernel messages can be seen by hitting &lt;CTRL-ALT-F4&gt;
*获得有限的bash壳内核可以按 &lt;CTRL-ALT-F2&gt;  
+
*Access to a limited BASH shell Kernel can be gained by hitting &lt;CTRL-ALT-F2&gt;
*您可以在任何时候返回到主安装屏幕通按&lt;CTRL-ALT-F1&gt;到文本界面, &lt;CTRL-ALT-F7&gt;到GUI界面.  
+
*You can return to the main installation screen at any time by hitting &lt;CTRL-ALT-F1&gt; for text based installations and &lt;CTRL-ALT-F7&gt; when the GUI is used.  
*HTTP模式下检查服务器的<code>/var/log/httpd/access_log</code>和<code>/var/log/httpd/error_log</code> 文件;FTP模式下是 <code>/var/log/vsftpd.log文件</code>;NFS模式下是<code>/var/log/messages</code>文件.
+
*Examine your server's &lt;code&gt;/var/log/httpd/access_log, /var/log/httpd/error_log files for the HTTP method; the /var/log/vsftpd.log file for the FTP method; and your /var/log/messages file for the NFS method
  
 
=Automating Installation With Kickstart=
 
=Automating Installation With Kickstart=
第368行: 第380行:
 
Kickstart will then use NFS to get both the configuration file and the installation ISOs. The rest should be automatic.
 
Kickstart will then use NFS to get both the configuration file and the installation ISOs. The rest should be automatic.
  
= 结尾<br> =
+
= Conclusion  =
  
Fedora Linux安装的kickstart方式的可以大大减少安装作业系统的所花费的时间长度.时间节省不仅是因为网络连接速度比使用光碟快,而且还因为它可以单独留在家中安装一个预定的Linux的配置. kickstart服务器可以连接到一个隔离的无线网络,专责安装,对于数据中心有数以百计的Linux服务器来说,可能是一个好主意.
+
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.<br>
  
最近有一项标准,用所谓的PXE可让您运行kickstart在没有光碟有网卡的机器上,连接网络到DHCP伺服器.这个在本书题目的范围之外,但它可能是有趣的与更复杂的项目,读者可以查看更多资料.
+
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.
 +
[[Category:Quick_HOWTO]]

2010年7月23日 (五) 20:29的最新版本


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.Fedora Linux

Setting Up The Installation Server

Kickstart can be configured on an FTP, NFS or Apache server. Each method is explained below, but my experience has been that the Apache server has a number of advantages over the other two.

Using a web server for kickstart is generally easier because:

  • Sometimes a kickstart server has to be located on a remote network, often passing through a firewall. Strict firewall rules for HTTP are generally easier to configure than those for FTP or NFS.
  • The http:// nomenclature used by kickstart for accessing files is more familiar to users than that used for NFS and FTP. This may be important for you when configuring files for automated kickstart installation.

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.

Create The Installation Directories

We'll first create the directories /data/network-install/RPM and /data/network-install/ISO in which we will copy the necessary files

[root@bigboy tmp]# mkdir -p /data/network-install/RPM
[root@bigboy tmp]# mkdir -p /data/network-install/ISO

You now need to place the network installation driver files into the base directory.

Copying The Files

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:

1) Create a mount point for your CD ROM drive.

[root@bigboy tmp]# mkdir /mnt/cdrom

2) Mount your first Fedora CD ROM.

[root@bigboy tmp]# mount /dev/cdrom /mnt/cdrom

3) Copy the files from the CD ROM base directory to the hard disk

[root@bigboy tmp]# cp -r /mnt/cdrom/* /data/network-install/RPM

4)Unmount your CD ROM and use the eject command to retrieve it from the drive bay.

[root@bigboy tmp]# umount /dev/cdrom
[root@bigboy tmp]# eject cdrom

5)Repeat steps 2 to 4 with all your CDROMs. Overwrite files when prompted.

HTTP & FTP Preparation

Copy all the contents of each installation CD to the /data/network-install/RPM directory. This will require about 3-5 GB of space. When this is completed, your /data/network-install/RPM directory should look like this:

[root@bigboy tmp]# ls -1 /data/network-install/RPM
eula.txt
Fedora
fedora.css
GPL
images
index.html
isolinux
README-Accessibility
RELEASE-NOTES-en_US.html
repodata
RPM-GPG-KEY
RPM-GPG-KEY-beta
RPM-GPG-KEY-fedora
RPM-GPG-KEY-fedora-extras
RPM-GPG-KEY-fedora-legacy
RPM-GPG-KEY-fedora-rawhide
RPM-GPG-KEY-fedora-test
RPM-GPG-KEY-rawhide
stylesheet-images 
[root@bigboy tmp]#

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:

[root@bigboy tmp]# cd /data/network-install/ISO
[root@bigboy ISO]# dd if=/dev/cdrom of=filename.iso bs=32k
...
...
[root@bigboy ISO]# eject cdrom

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.

[root@bigboy ISO]# mount /mnt/cdrom
[root@bigboy ISO]# mkisofs -J -r -T -o filename.iso /mnt/cdrom
[root@bigboy ISO]# eject cdrom

Setup Your Webserver

You will now have to setup Apache to give the file listings of your /data/network-install/RPM and /data/network-install/ISO directories by pointing your browser to the URL http://192.168.1.100/network-install/RPM/ or http://192.168.1.100/network-install/ISO/ respectively. A sample /etc/httpd/conf.d/kickstart.conf configuration is below. Remember to restart Apache to make these settings take effect.

NameVirtualHost 192.168.1.100
 
#
# For HTTP Installations
#
<VirtualHost 192.168.1.100>
  DocumentRoot /data/
</VirtualHost>

<Directory /data/network-install>
   Options +Indexes
   AllowOverride AuthConfig
   order allow,deny
   allow from all
</Directory>


Setup Your FTP Server

You'll also have to set up your VSFTPD server to make incoming anonymous FTP connections log in to the /data/network-install/RPM directory by default. You will also want to enable the correct logging. Here is a sample snippet of the vsftpd.conf file. Remember to restart VSFTPD to make these settings take effect.

#
# 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

Create A Special FTP User

You can also create a special user for non anonymous FTP installations with its home directory as "/". You must also make sure that the user has read access to the /data/network-install directory. An example is below.

[root@bigboy tmp]# useradd -g users ftpinstall
[root@bigboy tmp]# passwd ftpinstall
Changing password for user ftpinstall.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@bigboy tmp]#
[root@bigbot tmp]# usermod -d / ftpinstall
[root@bigbot tmp]#



Setup Your NFS Server

The steps for setting up an NFS server are more complicated.


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 portmap, 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.

[root@bigboy tmp]# exportfs -ra


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.


[root@bigboy tmp]# host 192.168.1.96
96.1.168.192.in-addr.arpa domain name pointer 192-168-1-96.my-site.com.
[root@bigboy tmp]#
 
[root@bigboy tmp]# host 192-168-1-96.my-site.com
192-168-1-96.my-site.com has address 192.168.1.96
[root@bigboy tmp]#


his 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.

Configure Your DHCP Server

During the installation procedure, the installation client will prompt you for the IP address it should use for the installation process. I recommend selecting the option that makes the Installation Client get its address via DHCP. This will automate the installation more and will therefore make it faster. It will also reduce the possibility of human error.


Setting up the Installation Server as a DHCP server is fairly straight forward and can be found in Chapter 8, "Configuring the DHCP Server".

Creating A Boot CD

You will also need the first CD in your set of Fedora CDs will work. You can either copy an existing disk, or burn a copy of the FC2-i386-disc1.iso file onto a CD.

The Network Installation

From here on, the installation procedure mimics the regular Linux installation, except for the first couple steps.

1) Connect your client Linux box to the DHCP network.

2) Boot your system using the first Fedora installation CD. This is the only CD you'll need for future network installations.

3) Enter the command "linux askmethod" at the boot: prompt

4) Hit the <Enter> key

5) Go through the usual steps until it prompts for the "Installation Method". You will see a number of choices

Local 
CDROM
Hard Drive
NFS Image
FTP
HTTP


6) Select the network option of your choice (NFS, FTP, HTTP)

7) Select the Ethernet device to which the installation client is connected to the installation server network. This would most likely be interface "eth0".

8) Select "DHCP" in the following "Configure TCP/IP" screen. This will make the Installation client use DHCP during the installation.

If You Selected The NFS Method

You will now reach the "NFS setup" menu. Enter the IP address of the installation server as the "NFS Server Name". The "Red Hat directory" will be "/data/network-install/ISO". The following menus will be the usual Fedora GUI installation screens.

If You Selected The HTTP Method

You will now reach the "HTTP Setup" menu. Enter the IP address of the installation server when prompted for a "Web site name".The "Red Hat directory" will be /network-install. The following menus will be text based versions of the usual Fedora installation screens.

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.

[root@bigboy tmp]# tail -f /var/log/httpd/access_log
192.168.1.247 - - [12/Nov/2006:12:01:04 -0800] "GET /network-install/RPM/repodata/repomd.xml HTTP/1.1" 200 1140 "-" "urlgrabber/2.9.9"
192.168.1.247 - - [12/Nov/2006:12:01:05 -0800] "GET /network-install/RPM/repodata/primary.xml.gz HTTP/1.1" 200 844228 "-" "urlgrabber/2.9.9"
192.168.1.247 - - [12/Nov/2006:12:01:19 -0800] "GET /network-install/RPM/repodata/comps.xml HTTP/1.1" 200 853899 "-" "urlgrabber/2.9.9"

If You Selected The FTP Method

You will now reach the "FTP Setup" menu. Enter the IP address of the installation server as the "FTP Site Name".

  • "Not Selecting" The Non-Anonymous FTP Box

The "Red Hat directory" will be "/". The following menus will be text based versions of the usual Fedora installation screens.

  • "Selecting" The Non-Anonymous FTP Box

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.

[root@bigboy ~]# tail -f /var/log/vsftpd.log 
Sun Nov 12 20:53:12 2006 1 192.168.1.231 1140 /data/network-install/RPM/repodata/repomd.xml b _ o r ftp-install ftp 0 * c
Sun Nov 12 20:53:21 2006 2 192.168.1.231 844228 /data/network-install/RPM/repodata/primary.xml.gz b _ o r ftp-install ftp 0 * c
Sun Nov 12 20:53:40 2006 2 192.168.1.231 853899 /data/network-install/RPM/repodata/comps.xml b _ o r ftp-install ftp 0 * c

Troubleshooting The Network Installation

You can do some basic troubleshooting by accessing the various installation status screens available.

  • The installation logs can always be viewed by hitting <CTRL-ALT-F3>
  • Kernel messages can be seen by hitting <CTRL-ALT-F4>
  • Access to a limited BASH shell Kernel can be gained by hitting <CTRL-ALT-F2>
  • You can return to the main installation screen at any time by hitting <CTRL-ALT-F1> for text based installations and <CTRL-ALT-F7> when the GUI is used.
  • Examine your server's <code>/var/log/httpd/access_log, /var/log/httpd/error_log files for the HTTP method; the /var/log/vsftpd.log file for the FTP method; and your /var/log/messages file for the NFS method

Automating Installation With Kickstart

Both Fedora and RedHat Linux save all the parameters you used during installation in the /root/anaconda-ks.cfg kickstart configuration file. You can use this file to create an automated installation of a duplicate system which can be useful if you have a large number of servers to install.

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.

How To Create New Kickstart Configuration Files

You can create a customized kickstart configuration file by using the "ksconfig" command from a GUI console. It will bring up a menu from which you can select all your installation options. When finished, you save the configuration with the filename of your choice.

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.

Adding Post Installation Commands

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

A Note About Using anaconda-ks.cfg

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.

How To Run A Kickstart Installation

It is best to place your kickstart files in a subdirectory under the /data/network-install directory. The examples below assume the subdirectory is called /data/network-install/kickstart.

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.

Using a NFS Server

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

Using a Web Server

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

Booting With Your Kickstart Files

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:

Manually Specifying the Kickstart Filename

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

boot: linux ks=nfs:192.168.1.100:/kickstart/ks.cfg

HTTP Method

boot: linux ks=http://192.168.1.100/network-install/kickstart/ks.cfg

Configuring The Filename Automatically

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:

1) Place your kickstart file in the /data/network-install/kickstart directory.

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.