Linux CentOS PXE+Kickstart
2015-09-11 14:55
393 查看
PXE+Kickstart安装条件和步骤
首先,大家如果看到有什么不懂的地方,欢迎吐槽!!!我会在当天或者第二天及时回复,并且改进~~
安装条件
DHCP Server
TFTP Server
Kickstart 所生成的ks.cfg文件
存放系统安装文件的服务器,如NFS,FTP,HTTP
支持PXE的网卡NIC
思路
1、桌面 Desktop、Desktop Platform、Fonts、X Window System 2、TFTP File(boot.msg/vmlinuz/initrd.img/pxelinux.0) Directory pxelinux.cfg(default) 3、DHCP 提供IP地址,并且指定TFTPServer 的IP地址和引导文件 4、HTTP 提供系统文件的下载地址 5、Kickstart ks.cfg文件无需用户手动干预而无人值守安装系统
详细步骤
1、kickstart生成ks.cfg文件需要Desktop的支持
yum -y groupinstall “Desktop” “Desktop Platform” “Fonts” “X Window System” vi /etc/inittab default:3 改为 default:5 | reboot
2、安装http服务。挂载镜像iso,并将镜像文件拷贝到http服务的”DocumentRoot”文档根目录下
yum -y install httpd mount /dev/cdrom /media cp -rf /media/* /var/www/html/
3、安装TFTP Server
yum -y install tftp-server vi /etc/xinetd.d/tftp #将disable = yes 改为no server_args = -s /tftpboot #更改tftp服务目录
4、配置支持PXE的启动程序
yum -y install syslinux mkdir -p /tftpboot/pxelinux.cfg cp /var/www/html/isolinux/vmlinuz /tftpboot cp /var/www/html/isolinux/initrd.img /tftpboot cp /usr/share/syslinux/pxelinux.0 /tftpboot cp /var/www/html/*.msg /tftpboot cp /var/www/html/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default vim /tftpboot/pxelinux.cfg/default Default linux ks=http://192.168.10.199/ks.cfg #在httpd文档目录下 Timeout 1 #超时时间改为1
5、配置DHCP服务器
在全局配置中加入:
Filename “pxelinux.0”; #指定引导系统启动的文件位置 Next-server 192.168.10.199; #指定TFTP Server的位置
6、开始安装Kickstart,同时配置system-config-kickstart
yum -y install system-config-kickstart System-config-kickstart #在GNOME环境下执行并配置 Installation Method http server 192.168.10.199 http Directory / Partition Information Master Boot Record Clear Master Boot Record Partitions Remove all existing partitions Disk label Initialize the disk label Layout 依次根据需要划分,例如(/,/boot,/swap)
7、保存ks.cfg文件与httpd根目录
/var/www/html
8、修改default文件
Vim default Default linux ks=http://192.168.10.199/ks.cfg Timeout 1 Chkconfig httpd on Chkconfig xinetd on Chkconfig dhcpd on Service httpd start Service xinetd start Service dhcpd start Service iptables stop Setenforce 0 Vi /etc/selinux/config #disable
Ks.cfg 文件配置
#platform=x86, AMD64, or Intel EM64T #硬件平台 #version=DEVEL # Firewall configuration #防火墙配置 firewall --disabled # Install OS instead of upgrade #安装or升级系统 install # Use network installation #网络安装 url --url="http://192.168.10.199/" # Root password #root 密码 rootpw --iscrypted $1$nVrLmmxz$.QpCBfTN48BebDBb47YEQ1 # System authorization information #系统验证信息 auth --useshadow --passalgo=sha512 # Use graphical install #图形化安装 graphical firstboot --disable # System keyboard #系统键盘设置 keyboard us # System language #系统语言 lang en_US # SELinux configuration #SELinux配置 selinux --disabled # Installation logging level #安装日志级别 logging --level=info # System timezone #系统时区 timezone Asia/Shanghai # System bootloader configuration #系统启动加载 bootloader --location=mbr # Clear the Master Boot Record #清除主启动记录 zerombr # Partition clearing information #分区清除信息 clearpart --all --initlabel # Disk partitioning information #磁盘分区信息 part /boot --fstype="ext4" --size=300 part swap --fstype="swap" --size=1024 part / --fstype="ext4" --grow --size=1 #--grow --size=1 代表将剩余的所以后空间分配给/分区 %packages @chinese-support %end Reboot #此选项必须存在,否则系统会让用户手动选择是否清除所有数据
相关文章推荐
- 阿里云centos+ngnix+mysql配置相关事项
- linux下vim对于意外退出的文档的再次开启
- centos下MySQL升级
- 为何说 Ubuntu 是使用最广泛的 Linux 操作系统的五大理由
- linux 多台 主机的免登录ssh的配置
- 配置torch,luarocks 在linux下
- Linux 获取设备树源文件(DTS)里描述的资源【转】
- rpm yum apt-get redhat centos ubuntu
- Linux atime ctime mtime的不同
- GDB学习之Core Dump-linux
- Redhat6.5使用centos yum源
- 查看linux服务器状态常用命令
- 虚拟机centos6.5 --设置静态ip
- linux下vim命令详解
- Linux命令中的tar命令
- linux mysql找回密码
- linux 文件组织结构--转载
- 实战Linux设备驱动--万事开头难--HelloWorld
- Linux批量查找文件内容
- linux下通过yum安装svn及配置