码迷,mamicode.com
首页 > 其他好文 > 详细

pxe无人值守自动安装

时间:2015-11-10 15:32:55      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:

rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum list
yum update
yum -y install tftp-server
rpm -ql tftp-server
/var/lib/tftpboot   tftp根目录
chkconfig tftp on
chkconfig --list tftp
ss -unlp | grep 69
yum install syslinux
mount -o loop CentOS-6.6-x86_64-bin-DVD1.iso /mnt
cp /mnt/isolinux/{vesamenu.c32,vmlinuz,initrd.img,initrd.img} /var/lib/tftpboot/
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
yum -y install dhcp
vim /etc/dhcp/dhcpd.conf
subnet 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 configtest
yum install httpd
vi /etc/httpd/conf/httpd.conf
ServerName 127.0.0.1:80
/etc/init.d/httpd start
ss -ntlp | grep 80
umount /mnt/
mount -o loop /data/CentOS-6.6-x86_64-bin-DVD1.iso /var/www/html/centos6/
mv /etc/yum.repos.d/* ~/
vim /var/www/html/ks.cfg
#version=DEVEL
    # Firewall configuration
    firewall --disabled
    # Install OS instead of upgrade
    install
    # Use network installation
    url --url="http://192.168.1.103/centos6"
    # Root password
    rootpw --iscrypted $1$root$b1EYqyfO7el5lPgcPXQKw0
    # System authorization information
    auth  --useshadow  --passalgo=sha512
    # Use text mode install
    text
    firstboot --disable
    # System keyboard
    keyboard us
    # System language
    lang zh_CN
    # SELinux configuration
    selinux --disabled
    # Installation logging level
    logging --level=info
    # Reboot after installation
    reboot
    # System timezone
    timezone  Africa/Abidjan
    # 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=200
    part swap --fstype="swap" --size=2048
    part / --fstype="ext4" --grow --size=1
     
    %packages
    @chinese-support
     
    %end

--------------------------------------------------------------------------------------
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
part / --fstype ext3 --start=1 --end=250 --ondisk=sda  根分区类型、挂载点、大小
part /home --fstype ext3 --start=251 --end=1000 --ondisk=sda
part /usr --fstype ext3 --start=1001 --end=5000 --ondisk=sda
part /usr/local --fstype ext3 --start=5001 --end=7000 --ondisk=sda

参考资料:
http://www.syslinux.org/wiki/index.php/PXELINUX
http://linux.vbird.org/linux_enterprise/0120installation.php#kstart_what
http://wenku.baidu.com/link?url=HBgl5CsT4V2UXRMEHDqnu3LID0Fy9cUbmNVi_jdCfGdwzsI-m-p2qzDvOyEeiPUVy5TJYu2f9EPkipw2hjxvRl7v4aP6xPDiVfcODzOMWKq

pxe无人值守自动安装

标签:

原文地址:http://www.cnblogs.com/zclzhao/p/4952913.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!