pxe无人值守自动安装

mac2022-06-30  76

rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpmyum listyum updateyum -y install tftp-serverrpm -ql tftp-server/var/lib/tftpboot   tftp根目录chkconfig tftp on

chkconfig xinetd onchkconfig --list tftpss -unlp | grep 69

vi /etc/xinetd.d/tftp

service tftp{        disable = no        socket_type             = dgram        protocol                = udp        wait                    = yes        user                    = root        server                  = /usr/sbin/in.tftpd        server_args             = -u nobody -s /var/lib/tftpboot        per_source              = 11        cps                     = 100 2        flags                   = IPv4}yum install syslinuxmount -o loop CentOS-6.6-x86_64-bin-DVD1.iso /mntcp /mnt/isolinux/{vesamenu.c32,vmlinuz,initrd.img} /var/lib/tftpboot/

cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/mkdir /var/lib/tftpboot/pxelinux.cfgcp /mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/defaultyum -y install dhcpvim /etc/dhcp/dhcpd.confsubnet 192.168.1.0 netmask 255.255.255.0 {option routers 192.168.1.1;option subnet-mask 255.255.255.0;option domain-name-servers 192.168.1.108;option time-offset -18000;range dynamic-bootp 192.168.1.200 192.168.1.230;default-lease-time 21600;max-lease-time 43200;# Group the PXE bootable hosts together# # PXE-specific configuration directives...next-server 192.168.1.108;filename "pxelinux.0";authoritative; }service dhcpd configtestyum install httpdvi /etc/httpd/conf/httpd.confServerName 127.0.0.1:80/etc/init.d/httpd startss -ntlp | grep 80umount /mnt/mount -o loop /data/CentOS-6.6-x86_64-bin-DVD1.iso /var/www/html/centos6/vim /var/www/html/pxe-ks.cfg

# Kickstart file automatically generated by anaconda.#version=DEVELinstallurl --url=http://192.168.1.108/centos6lang zh_CN.UTF-8keyboard usnetwork --onboot yes --device eth0 --bootproto dhcp --noipv6rootpw  --iscrypted $6$k80gonzUBxLGIIOw$q2VJzcf5gqIbxhEJRdLzqHxWjW/b3z9KzpuQBRCnxGLxpOsluzwFUoUmJIV84Eptftp6J4zhgWem/p1Ug1tNt1firewall --service=sshauthconfig --enableshadow --passalgo=sha512selinux --enforcingtimezone Asia/Shanghaibootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"reboot# The following is the partition information you requested# Note that any partitions you deleted are not expressed# here so unless you clear all partitions first, this is# not guaranteed to workzerombrclearpart --allpart /boot --fstype=ext4 --asprimary --size=600part / --fstype=ext4 --asprimary --size=10240part swap --asprimary --size=2048part /data --fstype=ext4 --grow --asprimary --size=200repo --name="CentOS"  --baseurl=http://192.168.1.108/centos6 --cost=100%packages@base@chinese-support@core@british-support@system-management-snmp@server-policy@system-admin-tools@workstation-policypython-dmidecodesgpiodevice-mapper-persistent-data%end

 

vi /var/lib/tftpboot/pxelinux.cfg/default末尾添加:label pxemenu label ^pxekernel vmlinuzappend initrd=initrd.img ks=http://192.168.1.108/pxe-ks.cfg

--------------------------------------------------------------------------------------vi /var/lib/tftpboot/pxelinux.cfg/default 启动界面在这修改  default linux        # 默认启动的是 'label linux' 中标记的启动内核  prompt 1             # 显示 'boot: ' 提示符  timeout 60          # 等待超时时间,单位为 1/10 秒,超时后自动启动 默认指定的label       display boot.msg    # 显示boot.msg的内容,文件路径是相对tftp server 的根目录(默认 /tftpboot),所以boot.msg文件绝对路径在 /tftpboot/boot.msg

menu.c32 提供类菜单模式的功能pxelinux.0  开机管理程式pxelinuxcfg 开机的选单设定vesamenu.c32 图形化界面菜单vmlinuz  安装软件核心文档(kernel file)initrd.img 开机过程所需要的模块参数isolinux.cfg -->demo  作为pxe所需开机菜单

--size 规范分割的大小--grow 系统自动去判断最大可用容量,然后通通分给该分区--asprimary 将该分割强制列在主要分割类型中--grub-crypt   rootpw密码获取part / --fstype ext3 --start=1 --end=250 --ondisk=sda  根分区类型、挂载点、大小part /home --fstype ext3 --start=251 --end=1000 --ondisk=sdapart /usr --fstype ext3 --start=1001 --end=5000 --ondisk=sdapart /usr/local --fstype ext3 --start=5001 --end=7000 --ondisk=sda

%pre,%post 安装前、安装后的额外动作%pre#----创建raid---------##创建strip size 64k的raid0megacli -cfglddel  -L1 -a0megacli -cfgldadd -r1[32:6,32:7] -wt -ra  -strpsz64 -force -a0 megacli -CfgLdAdd -r0[14:2] wb ra Cached -strpsz64 -a0megacli -cfgldadd -r5[0:2,0:3,0:4] -wb -ra Cached -strpsz64 -a0%post

MegaCli-8.07.10-1.noarch

转载于:https://www.cnblogs.com/zclzhao/p/4952913.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)