栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

PXE全自动安装Linux

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

PXE全自动安装Linux

安装环境

    yum -y install tftp tftp-server dhcp syslinux
    
    
    chkconfig xinetd off
    chkconfig –level 3 xinetd on
    chkconfig tftp off
    chkconfig –level 3 tftp on
    chkconfig dhcpd off
    chkconfig –level 3 dhcpd on
    chkconfig portmap off
    chkconfig –level 3 portmap on
    chkconfig nfs off
    chkconfig –level 3 nfs on

配置

    vi /etc/xinetd.d/tftp
    vi /etc/dhcpd.conf
    ddns-update-style interim;
    ignore client-updates;
    
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers                  192.168.1.1;
    option subnet-mask              255.255.255.0;
    filename “pxelinux.0″;
    next-server 192.18.1.110;
    option domain-name-servers      192.168.1.1;
    option time-offset              -18000; # Eastern Standard Time
    range dynamic-bootp 192.168.1.200 192.168.1.210;
    default-lease-time 21600;
    max-lease-time 43200;
    
    
    # we want the nameserver to appear at a fixed address
    host ns {
    next-server marvin.redhat.com;
    hardware ethernet 12:34:56:78:AB:CD;
    fixed-address 207.175.42.254;
    }
    }
    service xinetd restart
    service tftp restart

#组建PXE环境

    mkdir -p /tftpboot/pxelinux.cfg
    cp /usr/lib/syslinux/pxelinux.0 /tftpboot
    cp /usr/lib/syslinux/menu.c32 /tftpboot
    cp /CentOS5.5/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
    cp /CentOS5.5/images/pxeboot/initrd.img /tftpboot
    cp /CentOS5.5/images/pxeboot/vmlinuz /tftpboot
    chmod u+w /tftpboot/pxelinux.cfg/default
    vi /tftpboot/pxelinux.cfg/default
    default menu.c32
    timeout 15
    
    
    label auto
    menu label Auto Install CentOS5.5_32bit
    menu default
    kernel vmlinuz
    append ks=nfs:192.168.1.110:/CentOS5.5/ks.cfg initrdinitrd=initrd.img
    label custom
    menu label Custom Install CentOS5.5_32bit
    kernel vmlinuz
    append initrdinitrd=initrd.img
    label rescue
    menu label Rescue
    kernel vmlinuz
    append ks initrdinitrd=initrd.img rescue

#配置nfs

    vi /etc/exports
    /CentOS5.5     *(ro)
    service portmap start
    service nfs start
    exportfs

#kickstart

    yum -y install system-config-kickstart(须安装桌面环境)
    
    
    vi ks.cfg
    #platform=x86, AMD64, or Intel EM64T
    # System authorization information
    auth  –useshadow  –enablemd5
    # System bootloader configuration
    bootloader –location=mbr
    # Clear the Master Boot Record
    zerombr
    # Partition clearing information
    clearpart –all –initlabel
    # Use graphical install
    #graphical
    text
    # Firewall configuration
    firewall –disabled
    key –skip
    # Run the Setup Agent on first boot
    firstboot –disable
    # System keyboard
    keyboard us
    # System language
    lang en_US
    # Installation logging level
    logging –level=info
    # Use network installation
    #url –url=http://192.168.1.110/centos/
    nfs –server=192.168.1.110 –dir=/CentOS5.5
    # Network information
    network –bootproto=dhcp –device=eth0 –ononboot=on
    # Reboot after installation
    reboot
    #Root password
    rootpw –iscrypted $1$3LO7K8pW$mvZZ/qaBakJNgz.v3RjRs1
    
    
    # SELinux configuration
    selinux –disabled
    # Do not configure the X Window System
    skipx
    # System timezone
    timezone  Asia/Shanghai
    # Install OS instead of upgrade
    install
    # Disk partitioning information
    part / –bytes-per-inode=4096 –fstype=”ext3″ –size=30720
    part swap –bytes-per-inode=4096 –fstype=”swap” –size=1024
    
    
    %packages
    @base
    @development-libs
    @development-tools
    @admin-tools
    @system-tools
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/10303.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号