手机版
你好,游客 登录 注册
背景:
阅读新闻

基于PXE,Kickstart实现通过网络自动安装CentOS6.5

[日期:2014-08-10] 来源:Linux社区  作者:dddbk [字体:大 中 小]

4.基于HTTPD配置yum软件仓库为PXE提供安装源

[root@localhost /]# rpm -q httpd

httpd-2.2.15-29.el6.CentOS.x86_64

#通过光盘提供yum仓库

[root@localhost /]# mount --bind /mnt/cdrom/ /var/www/html/cdrom/

#启动服务

[root@localhost /]# service httpd start

Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

                                                          [  OK  ]

#通过浏览器测试源是否可以正常访问

基于PXE,kickstart实现通过网络自动安装CentOS6.5

5.提供ks.cfg文件

#安装system-config-kickstart
[root@localhost /]# yum install system-config-kickstart
[root@localhost /]# rpm -q system-config-kickstart
system-config-kickstart-2.8.6.5-1.el6.noarch
#通过xstart运行systm-config-kickatart,生成ks.cfg文件

基于PXE,kickstart实现通过网络自动安装CentOS6.5基于PXE,kickstart实现通过网络自动安装CentOS6.5

 

#ks.kfg文件详细内容
[root@localhost /]# cat ~/ks.cfg
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://172.16.21.250/cdrom"
# Root password
rootpw --iscrypted $1$8kLebhx5$XaCCpB3fvBnQutl9iQW3S1
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
 
# System timezone
timezone  Asia/Chongqing
# Network information
network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all 
# Disk partitioning information
part / --fstype="ext4" --ondisk=sda --size=8000
part /boot --fstype="ext4" --ondisk=sda --size=500
part swap --fstype="swap" --size=1000
 
%packages
@chinese-support
@ftp-server
@internet-browser
@web-server
 
%end
6.测试可否通过网络远程自动安装系统

#指定ks文件位置并回车运行

基于PXE,kickstart实现通过网络自动安装CentOS6.5

#可以看到系统已经在自动分区

基于PXE,kickstart实现通过网络自动安装CentOS6.5

#正在安装软件包,可见yum源配置也没有问题

基于PXE,kickstart实现通过网络自动安装CentOS6.5

#系统安装完成

基于PXE,kickstart实现通过网络自动安装CentOS6.5

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-08/105383.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款