pxe 安装centos7.2 制作过程(hp x86 server)
来源:互联网 发布:网络攻击与防范 编辑:程序博客网 时间:2024/06/03 20:34
本文档是为了使用pxe 在hp x86 server上面安装 centos7.2,hp server 需要uefi pxe安装方式,本文需要做作efi引导文件。下面是具体步骤:
1、关闭selinux
setenforce 0sed -i '/^SELINUX=/ s/=.*/=disabled/ ' /etc/selinux/config
2、安装GRUB2+DHCP+TFTP+HTTP
yum install grub2-efi-modules tftp-server xinetd dhcp dhcp-devel dhcp-common httpd vsftpd
3. 配置tftp服务
sed -i '/disable/ s/yes/no/' /etc/xinetd.d/tftp
4. 配置DHCP
## DHCP Server Configuration file.# see /usr/share/doc/dhcp*/dhcpd.conf.example# see dhcpd.conf(5) man pageddns-update-style interim;allow booting;allow bootp;ignore client-updates;set vendorclass = option vendor-class-identifier;option architecture-type code 93 = unsigned integer 16;option pxe-system-type code 93 = unsigned integer 16;subnet 10.214.128.0 netmask 255.255.255.0 {range dynamic-bootp 10.214.128.10 10.214.128.50; # 分配地址范围option routers 10.214.128.1; #路由选择option subnet-mask 255.255.255.0; default-lease-time 21600; max-lease-time 43200;next-server 10.214.128.49; #dhcp server ip 地址filename "bootx64.efi"; #安装引导文件,步骤7会说明制作过程#网卡mac 和ip地址绑定host 48{hardware ethernet 14:02:ec:73:fc:70; fixed-address 10.214.128.48;}
后续如果修改该文件,需要重启dhcp服务。
5. 挂载ISO
mkdir -p /var/ftp/pubmount /opt/CentOS-7-x86_64-Everything-1511.iso /var/ftp/pub -o loop
6.配置ftp
cp /var/ftp/pub/EFI/BOOT/grub.cfg /var/lib/tftpboot/cp /var/ftp/pub/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/
7. 配置pxe启动引导文件
制作efi引导文件
cd /var/lib/tftpboot/
grub2-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi –modules=”tftp net efinet linux part_gpt efifwsetup” -o bootx64.efi
8、制作kickstart 文件
如果需要安装的系统的版本(特别是跨版本)之前没有被安装过,最好先用ISO安装一遍或者使用kickstart 图形界面制作kickstart文件;因为跨版本的kickstart的配置会有很大的变动。安装完成之后的" /root/anaconda-ks.cfg"文件可以作为kickstart的模板,然后在它的基础上修改成符合网络安装的kickstart模板。
修改kickstart模板文件如下:
如果有如下行,删除它:
# Use CDROM installation mediacdrom# Use graphical installgraphical# X Window System configuration informationxconfig --startxonboot
下面是模版ks.conf 模版
#platform=x86, AMD64, or Intel EM64T#version=DEVEL# Install OS instead of upgradeinstall# Keyboard layoutskeyboard 'us'# System timezonetimezone Africa/Abidjan# Use network installationurl --url="ftp://10.214.128.49/pub"# Root passwordrootpw --plaintext 123456# System languagelang en_US# Firewall configurationfirewall --disabled# System authorization informationauth --useshadow --passalgo=sha512firstboot --disable# SELinux configurationselinux --disabled# Network information 选择需要启动的网卡network --bootproto=dhcp --device=eno49 --onboot=on --ipv6=autonetwork --hostname=localhost.localdomain# Reboot after installationreboot# System bootloader configurationbootloader --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all --initlabel# Disk partitioning information#part / --fstype="ext4" --size=204800#/boot/efi必须是efi 格式,用户根据自己的需要定制分区。part /boot/efi --fstype=efi --size=200 --fsoptions="defaults,uid=0,gid=0,umask=0077,shortname=winnt"part /boot --fstype=ext4 --size=500part swap --recommendedpart pv.01 --grow --size=200volgroup wdvg pv.01logvol / --fstype=ext4 --vgname=wdvg --grow --size=20480 --name=root%packages@base%end
将该文件拷贝到/var/ftp
cp ks.conf /var/ftp/88.ks
9. 配置grub.conf使之能网络安装
grub.cfg模版
set default="1"function load_video {insmod efi_gopinsmod efi_ugainsmod video_bochsinsmod video_cirrusinsmod all_video}load_videoset gfxpayload=keepinsmod gzioinsmod part_gptinsmod ext2set timeout=60### END /etc/grub.d/00_header ###search --no-floppy --set=root -l 'CentOS 7 x86_64'### BEGIN /etc/grub.d/10_linux ###menuentry 'Install CentOS 7.2 wanda' --class fedora --class gnu-linux --class gnu --class os {linuxefi (tftp)/vmlinuz bootdev=bootif inst.lang=en_US inst.text inst.ks=ftp://10.214.128.49/88.ks inst.repo=ftp://10.214.128.49/pub ip=dhcpinitrdefi (tftp)/initrd.img}
10. 启动服务
systemctl enable httpd.servicesystemctl enable xinetd.servicesystemctl enable dhcpd.servicesystemctl restart httpd.servicesystemctl restart xinetd.servicesystemctl restart dhcpd.servicesystemctl disable firewalld.servicesystemctl stop firewalld.service
11、批量安装hp服务器
进入ilo -> 发送F12 进入 网络安装模式 -> 选择需要安装的系统。
参看:
https://github.com/openSUSE/kiwi/wiki/Setup-PXE-boot-with-EFI-using-grub2https://www.ibm.com/developerworks/community/blogs/a2674a1d-a968-4f17-998f-b8b38497c9f7?sortby=0&maxresults=10&lang=zhCentOS7 kickstart安装官方文档:https://access.redhat.com/documentation/zh-CN/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html#sect-kickstart-commandsGRUB2配置文件: http://www.jinbuguo.com/linux/grub.cfg.html通过UEFI启动pxe安装CentOS 7 : http://blog.chinaunix.net/uid-22621471-id-4980582.html
0 0
- pxe 安装centos7.2 制作过程(hp x86 server)
- centos7.1作为pxe机安装XenServer6.2
- CentOS7.2下PXE+kickstart自动化安装系统
- CentOS7 PXE安装批量安装操作系统
- 在PXE服务器安装Centos7.1
- PXE自动化安装centos6和centos7
- HP服务器安装Sql Server 2005过程中的问题
- 基于PXE的系统全自动化安装--(centos6.9没问题;centos7有bug)
- pxe安装linux主要过程记录
- 关于PXE安装过程中遇到坑
- 搭建PXE网络启动服务器安装CentOS7系统
- CentOS7下的PXE无人值守系统安装
- Centos7使用PXE+Kickstart无人值守安装服务
- PXE无法安装CENTOS7的一个现象及解决
- centos7(vm)下安装Ambari2.4.0(x86)
- centos7(vm)下sqoop1.99.7安装(x86)
- centos7(vm)下 mysql安装(x86)
- centos7.3 zabbix3.2 安装server端
- 类的大小
- 导出PDF乱码
- HDU 2940 Hex Factorial 高精度乘法
- 初始者 学习java准备工作
- oracle 创建新表,并复制旧表数据
- pxe 安装centos7.2 制作过程(hp x86 server)
- 第十四周 OJ总结<2>--输入一个数插入有序数组中
- 深入研究Java类加载机制
- thinkphp 通过“命令模式” 定义计划任务
- iOS-SVN无法上传静态库(.a)解决方案
- iOS:Swift自定义print
- cgo的一些经验
- 接口获取页面url参数
- 微信接入探秘(三)——加密消息的处理