XE+kickstart下自动安装centOS6.5
时间:2015-09-11 01:17 来源:blog.51cto.com 作者:LJ_baby
[root@node1 ~]
# yum install dhcp
[root@node1 ~]
# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
[root@node1 ~]
# vim /etc/dhcp/dhcpd.conf
option domain-name
"baby.org"
;
#域名搜索列表
option domain-name-servers 114.114.114.114;
#域名服务器地址
default-lease-
time
600;
#默认租约期限(单位秒)
max-lease-
time
7200;
#最大租约期限(单位秒)
log-facility local7;
#使用rsyslog存储日志
subnet 192.168.3.0 netmask 255.255.255.0 {
range 192.168.3.10 192.168.3.254;
#地址池
option routers 192.168.3.1;
#网关
option broadcast-address 192.168.3.31;
#广播地址
default-lease-
time
600;
max-lease-
time
7200;
next-server 192.168.3.2;
#下一个访问的服务器地址(tftp)
filename
"pxelinux.0"
;
#在next-server上需要下载的文件
}
[root@node1 ~]
# service dhcpd configtest
Syntax: OK
[root@node1 ~]
# service dhcpd start
Starting dhcpd: [ OK ]
[root@node1 ~]
# yum install tftp-server
[root@node1 ~]
# chkconfig tftp on
[root@node1 ~]
# vim /etc/xinetd.d/tftp
service tftp
{
disable = no
#服务已变为可用状态
socket_type = dgram
protocol = udp
wait =
yes
user = root
server =
/usr/sbin/in
.tftpd
server_args = -s
/var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
[root@node1 ~]
# service xinetd restart
Stopping xinetd: [FAILED]
Starting xinetd: [ OK ]
[root@node1 ~]
# yum install httpd
[root@node1 ~]
# mkdir -pv /var/www/html/centos/6/x86_64
mkdir
: created directory `
/var/www/html/centos
'
mkdir
: created directory `
/var/www/html/centos/6
'
mkdir
: created directory `
/var/www/html/centos/6/x86_64
'
[root@node1 ~]
# mount --bind /mnt/flash/ /var/www/html/centos/6/x86_64/
[root@node1 ~]
# service httpd start
[root@node1 ~]
# cp /mnt/flash/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/
[root@node1 ~]
# cp /mnt/flash/isolinux/{boot.msg,vesamenu.c32,splash.jpg} /var/lib/tftpboot/
[root@node1 ~]
# mkdir /var/lib/tftpboot/pxelinux.cfg
[root@node1 ~]
# cp /mnt/flash/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
[root@node1 ~]
# yum install syslinux
[root@node1 ~]
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@node1 ~]
# vim /var/lib/tftpboot/pxelinux.cfg/default
..........
..........
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=http:
//192
.168.3.2
/ks_file/ks
.cfg text
[root@node1 ~]
# cp /root/anaconda-ks.cfg /var/www/html/ks_file/ks.cfg
[root@node1 ~]
# chmod +r /var/www/html/ks_file/ks.cfg
[root@node1 ~]
# vim /var/www/html/ks_file/ks.cfg
text
#以文本界面安装
reboot
#安装完成后自动重启
selinux --disabled
#禁用selinux
.....
#以下是磁盘分区内容
clearpart --all --drives=sda
part
/boot
--fstype=ext4 --size=500
part pv.008002 --grow --size=1
volgroup vg_node1 --pesize=4096 pv.008002
logvol
/home
--fstype=ext4 --name=lv_home --vgname=vg_node1 --grow --size=100
logvol / --fstype=ext4 --name=lv_root --vgname=vg_node1 --grow --size=1024 --maxsize=51200
logvol swap --name=lv_swap --vgname=vg_node1 --grow --size=1984 --maxsize=1984
url --url=
"http://192.168.3.2/centos/6/x86_64"
repo --name=
"CentOS"
--baseurl=http:
//192
.168.3.2
/centos/6/x86_64
--cost=100
(责任编辑:IT)
(责任编辑:IT) |