PXE 安装 RedHat Enterprise Linux AS 4 update 7 (linux版)
来源:互联网 发布:程序员鼓励师慰安妇 编辑:程序博客网 时间:2024/05/09 23:08
公司购买了一批HP DL360G5服务器,数量大约有200台。要统一安装 RedHat Enterprise Linux AS 4 update 7 操作系统。如果一台一台手动安装不但费时费事,更是会让我羸弱的身体雪上加霜。于是公欲善其事,必先利其器。我决定使用PXE来批量安装这批服务器。
以下是安装配置的过程:
硬件和软件环境:
硬件:找一台安装了RedHat Enterprise Linux AS 4 update 7 系统的服务器,一台48口千兆交换机(没有千兆交互机可以用百兆交换机替代)
软件:tftp-server、dhcpd、vsftpd
软件安装配置过程:
1、安装tftp-server
从 RedHat Enterprise Linux AS 4 update 7 安装光盘找到 tftp-server-0.39-3.el4.i386.rpm 软件包并安装。
修改 /etc/xinetd.d/tftp 文件:
# description: The tftp server serves files using the trivial file transfer /
# protocol. The tftp protocol is often used to boot diskless /
# workstations, download configuration files to network-aware printers, /
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no #将原来的yes改成no
per_source = 11
cps = 100 2
flags = IPv4
}
重启 xinetd 服务
#service xinetd restart。
配置tftpboot目录内的文件
复制 RedHat Enterprise Linux AS 4 update 7 安装光盘中 /images/pxeboot/ 目录下的initrd.img和vmlinuz到/tftpboot目录下。
从 http://www.kernel.org/pub/linux/utils/boot/syslinux/ 下载最新版的 syslinux。我下载的是syslinux-3.84.zip。
解压syslinux-3.84.zip
复制其中的com32/menu/vesamenu.c32 到 /tftpboot 目录下。
复制其中的core/pxelinux.0 到 /tftpboot 目录下。
复制其中com32/hdt/art/backgnd.png 到 /tftpboot 目录下。
在 /tftpboot 目录下新建一个目录pxelinux.cfg
在 /tftpboot/pxelinux.cfg 目录下建立default文件,内容如下:
prompt 0
menu TITLE PXE Boot Install Menu By WOSZM
MENU BACKGROUND backgnd.png
timeout 100
label linux4u7
MENU LABEL ^0----Install RedHat AS4 update 7
kernel vmlinuz
append ks=ftp://192.168.0.1/ks.cfg ksdevice=eth0 initrd=initrd.img ramdisk_size=8192
/tftpboot 目录下的内容如下:
-rw-r--r-- 1 root root 10155 Feb 5 10:53 backgnd.png
-rw-r--r-- 1 root root 4266944 Feb 1 10:05 initrd.img
-rwxr-xr-x 1 root root 16466 Feb 1 10:04 pxelinux.0
-drwxr-xr-x 2 root root 4096 Feb 5 11:31 pxelinux.cfg
.----------rwxr-xr-x 1 root root 103 Feb 5 11:31 default
-rwxr-xr-x 1 root root 158364 Feb 5 10:48 vesamenu.c32
-rw-r--r-- 1 root root 1545551 Feb 1 10:05 vmlinuz
2、安装vsftpd
从 RedHat Enterprise Linux AS 4 update 7 安装光盘找到 vsftpd-2.0.1-6.el4.i386.rpm 软件包并安装。
vsftpd默认支持匿名下载,无需修改配置,只要启动 vsftpd 服务#service vsftpd start。
建立 RedHat Enterprise Linux AS 4 update 7 安装树。
#mount -o loop RHEL4.7-i386-AS-DVD.iso /mnt
#cp -avr /mnt /var/ftp/rhel
3、安装dhcpd
从 RedHat Enterprise Linux AS 4 update 7 安装光盘找到 dhcp-3.0.1-62.EL4.i386.rpm 软件包并安装。
修改 ll /etc/dhcpd.conf 文件:
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
#
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
#option domain-name-servers 192.168.0.1;
option time-offset -18000;
range dynamic-bootp 192.168.0.100 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.0.1;
filename "/pxelinux.0";
}
用以上的内容替换原来的文件内容。
修改服务器网卡eth0的配置文件 /etc/sysconfig/network-scripts/ifcfg-eth0:
BOOTPROTO=static
TYPE=Ethernet
ONBOOT=yes
IPADDR=192.168.0.1
NETMASK=255.255.255.0
修改dhcp启动网卡的配置文件 /etc/sysconfig/dhcpd
# Command line options hereDHCPDARGS=eth0
启动网卡#ifup eth0
启动dhcp服务#service dhcpd start
4、配置ks.cfg
按照下面的内容或者安装你需要的内容配置ks.cfg文件,并将文件复制大/var/ftp目录下。
# Kickstart file automatically generated by anaconda.
install
url --url=ftp://192.168.0.1/rhel/
lang zh_CN.UTF-8
langsupport --default=en_US.UTF-8 zh_CN.UTF-8 en_US.UTF-8
keyboard us
xconfig --card "ATI ES1000" --videoram 32768 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16 --startxonboot --defaultdesktop kde
text
network --device eth0 --bootproto dhcp
network --device eth1 --bootproto dhcp
rootpw --iscrypted $1$VhK0ct0.$yLPLHRWsKYEUFnNbGA4s2.
firewall --enabled --port=22:tcp --port=80:tcp --port=21:tcp --port=25:tcp
selinux --enforcing
poweroff
authconfig --enableshadow --passalgo=md5
timezone Asia/Shanghai
bootloader --location=mbr
# 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 --all --initlabel
part /boot --fstype ext3 --size=200
part swap --size=2048
part / --fstype ext3 --size=100 --grow
%packages
@ editors
@ emacs
@ system-tools
@ text-internet
@ dialup
@ ftp-server
@ compat-arch-support
@ legacy-software-development
@ chinese-support
@ development-tools
sysstat
-ckermit
-OpenIPMI-tools
-openldap-clients
rdesktop
-samba-client
kernel-devel
-bluez-pin
iptraf
-wireshark
kernel
-xdelta
e2fsprogs
-zsh
-open
grub
net-snmp-utils
%post
关于ks.cfg的其他具体参数请参考:https://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Installation_Guide-en-US/s1-kickstart2-options.html
剩下的事情就是端杯茶,慢慢品尝了。
本文出自 “小苗” 博客,请务必保留此出处http://7056824.blog.51cto.com/69854/278602
- PXE 安装 RedHat Enterprise Linux AS 4 update 7 (linux版)
- Redhat Enterprise Linux as 4 update 3
- Redhat Enterprise Linux AS 4 安装流程
- RedHat Enterprise Linux AS 3 UPDATE 4 download
- 01.18.05.REDHAT.ENTERPRISE.LINUX.AS.V3.0.UPDATE.4-RORiSO
- 在RedHat Enterprise Linux AS 4 安装成功小企鹅输入法fcitx
- 32位RedHat Enterprise Linux 5 Update 4下安装Oracle10.2.0.1(转载)
- redhat enterprise linux 4as: LAMP, pvpgn, ghost++, allstats
- Redhat Linux Enterprise 4 上安装 oracle9i
- Red Hat Enterprise Linux AS release 4 (Nahant Update 4)yum及libaio安装
- RedHat Enterprise Linux 6.2安装
- RedHat as 4 Enterprise 安装rar
- 《红帽企业Linux 5.4》(Redhat Enterprise Linux V5 UPDATE 4)[光盘镜像]
- RedHat Enterprise Linux 5 update 2 配置笔记
- redhat enterprise linux as4 update 8(RHEL AS4 U8) 下载
- redhat enterprise linux as4 update 8(RHEL AS4 U8) 下载
- RedHat Enterprise Linux Server 5.2安装VMware Server 1.0.7
- win7下安装rhel7(redhat enterprise Linux 7) 双系统
- vfs慢慢开始!!!
- 跨表查询 model赋值问题
- 方法能重写,属性能重写吗?
- 一些对开发有用的网址
- 基于LVS的Linux负载均衡技术实现(第一篇:基本原理)
- PXE 安装 RedHat Enterprise Linux AS 4 update 7 (linux版)
- SSD硬盘的一些想法
- oracle 用户密码md5加密
- 【转】PowerPC VxWorks BSP分析(2)--PowerPC汇编
- Django 学习笔记(3)
- 中国软件技术大会企业架构总结
- 程序可以运行,但几个界面打不开
- 上帝是爱与公义的统一
- 今天刚进了这个网站