2013/02/20
kickstart无人值守安装原理
1.Dhcp
mount /dev/cdrom /mnt
yum install dhcp* -y
cp /usr/share/doc/dhcp-3/dhcpd.conf.sample /etc/dhcpd.conf
vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.18.0 netmask 255.255.255.0 {
option routers 192.168.18.1;
option subnet-mask 255.255.255.0;
filename "pxelinux.0";
next-server 192.168.18.42;
option time-offset -18000;
range dynamic-bootp 192.168.18.128 192.168.18.130;
default-lease-time 21600;
max-lease-time 43200;
}
service dhcpd restart
2.tftp
yum install tftp -y
vim /etc/xinetd.d/tftp
disable = yes 修改为no
3.复制PXE启动时的必要文件
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
mkdir /tftpboot/pxelinux.cfg
cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
cp /mnt/images/pxeboot/initrd.img /tftpboot/
cp /mnt/images/pxeboot/vmlinuz /tftpboot/
4.修改/tftpboot/pxelinux.cfg/default文件
chmod u+w /tftpboot/pxelinux.cfg/default
vim /tftpboot/pxelinux.cfg/default
default ks
label ks
kernel vmlinuz
append ks initrd=initrd.img ks=ftp://192.168.18.42/ks.cfg
5.system-config-kickstart -y
yum install system-config-kickstart -y
运行system-config-kickstart
生成ks.cfg文件,保存到/root下
Ks.cfg文件内容如下:
auth --useshadow --enablemd5
key --skip
bootloader --location=mbr
zerombr
clearpart --all --initlabel
graphical
firewall --disabled
firstboot --disable
keyboard us
lang zh_CN
logging --level=info
url --url=ftp://192.168.18.42/pub
network --bootproto=dhcp --device=eth0 --onboot=on
reboot
rootpw --iscrypted $1$BuH2sixd$LvRkhMm/qItkQklZp5dko.
selinux --disabled
timezone Asia/Shanghai
install
xconfig --defaultdesktop=GNOME --depth=8 --resolution=800x600
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100
part swap --bytes-per-inode=4096 --fstype="swap" --size=1000
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=15000
复制anaconda-ks.cfg文件中如下部分(是安装系统时软件包的安装情况),到ks.cfg文件的底端
%packages
@admin-tools
@base
@chinese-support
@core
@dialup
@editors
@gnome-desktop
@games
@graphical-internet
@graphics
@java
@legacy-software-support
@office
@printing
@sound-and-video
@text-internet
@base-x
kexec-tools
iscsi-initiator-utils
fipscheck
device-mapper-multipath
sgpio
emacs
libsane-hpaio
6.vsftp
yum install vsftp* -y
service vsftpd restart
7.cp /root/ks.cfg /var/ftp
8.mount /dev/cdrom /var/ftp/pub
9.测试工作站