CentOS下kickstart安裝筆記
CentOS 5.2,因為是測試機,沒删減内容,标準安裝。
關閉iptables和selinux,安裝系統時已經配置好
1. 如果沒有關閉,關閉的方法是:
/etc/init.d/iptables stop
Chkconfig iptables off
Vi /etc/selinux/config,修改
SELINUX=disabled
2. 安裝NFS, sftp, dhcp伺服器
yum –y install nfs-utils nfs-utils-lib nfs-utils-lib-devel dhcp
3. 安裝kickstart
Yum –y system-config-kickstart
4.配置dhcp伺服器
vi /etc/dhcpd.conf
ddns-update-style interim ;
ignore client-updates ;
allow booting ;
allow bootp ;
# A slightly different configuration for an internal subnet.
subnet 192.168.254.0 netmask 255.255.255.0 {
range 192.168.254.31 192.168.254.50 ;
option domain-name-servers 192.168.254.2;
#option domain-name "internal.example.org";
option routers 192.168.254.2 ;
option subnet-mask 255.255.255.0 ;
option broadcast-address 192.168.254.255 ;
filename "pxelinux.0" ;
default-lease-time 172800 ;
max-lease-time 1209000 ;
}
備注:伺服器配置ipaddr:192.168.254.21/24
/etc/init.d/dhcpd start
Chkconfig dhcpd on
5. sftp伺服器配置
vi /etc/xinetd.d/tftp
service tftp
{
socket_type= dgram
protocol= udp
wait= yes
user= root
server= /usr/sbin/in.tftpd
server_args= -s /tftpboot
disable= no
per_source= 11
cps= 100 2
flags= IPv4
/etc/init.d/xinetd start
Chkconfig xinetd on
6. nfs伺服器的配置
Vi /etc/exports
/share/admins 192.168.254.111/24(async,rw,no_subtree_check)
Mkdir –p /share/admins
/etc/init.d/nfs start
Chkconfid nfs on
7. PXE設定
7.1 拷貝安裝CD光牒到nfs目錄
Mount –o loop /dev/dvd /mnt/
Mkdir –p /share/admins/centos52
Cp –Rf /mnt/* /share/admins/centos52
7.2 建立pxe啟動選項
Yum –y install syslinux
Mkdir –p /tftpboot/centos52
Mkdir –p /tftpboot/pxelinux.cfg
Cd /tftpboot
;/ 複制以下檔案及檔案夾
Cp /usr/share/syslinux/mboot.c32 .
Cp /usr/share/syslinux/chain.c32 .
Cp /usr/share/syslinux/menu.c32 .
Cp /usr/share/syslinux/pxelinux.0 .
Cp /usr/share/syslinux/memdis .
Cp –R /mnt/isolinux cenos52/.
;/ pxe菜單編輯
vi pxeconfig.cfg/default
Default centos52
prompt 0
timeout 100
ONTIMEOUT local
#MENU TITLE Main Menu
#MENU INCLUDE pxelinux.cfg/graphics.conf
#MENU AUTOBOOT Starting Local System in 300 seconds
LABEL centos52
MENU LABEL ^Start install CentOS5.2
KERNEL menu.c32
APPEND pxelinux.cfg/centos52
Vi centos52
default default
prompt 1
label centos52
MENU LABEL ^Startdard mode install CentOS5.2
kernel /centos52/isolinux/vmlinuz
append initrd=/centos52/isolinux/initrd.img ramdisk_size=8192 ks=nfs:192.168.254.21:/share/admins/centos52/ks.cfg
label default
MENU LABEL ^Return to Main Menu
APPEND pxelinux.cfg/default
8. kickstat 配置
可以在圖形終端下運作system-config-kickstart,如圖:生成ks.cfg檔案
<a href="http://blog.51cto.com/attachment/201311/103541449.png" target="_blank"></a>
拷貝ks.cfg到nfs目錄(centos52菜單對應的路徑)
開台機器測試!
配置完成,貼個ks.cfg配置菜單
#platform=x86, AMD64, 或Intel EM64T
# System authorization information
auth--useshadow--enablemd5
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --linux --initlabel
#skip key enter
key --skip
# Use graphical install
graphical
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.254.21 --dir=/share/admins/centos52
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$PYNuUfV6$WdL1kAbFQQYNnliJgczz3.
# SELinux configuration
selinux --disabled
# System timezone
timezone --isUtc Asia/Chongqing
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig--defaultdesktop=GNOME --depth=24 --resolution=640x480
# Disk partitioning information
part /boot --bytes-per-inode=4096 --fstype="ext2" --size=100
part swap --bytes-per-inode=4096 --fstype="swap" --size=1024
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=15000
%packages
@base-x
@gnome-desktop
@office
@editors
@text-internet
@dialup
@core
@base
@games
@chinese-support
@graphics
@printing
@sound-and-video
@graphical-internet
Deployment_Guide-en-US
device-mapper-multipath
xorg-x11-server-Xnest
libsane-hpaio
-sysreport
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1
本文轉自 chengchow 51CTO部落格,原文連結:http://blog.51cto.com/chengchow/1329910,如需轉載請自行聯系原作者