Welcome 微信登录

首页 / 操作系统 / Linux / Kickstart无人值守批量安装Linux系统

蓝色:输入的命令部分红色:修改的配置文件1、挂载系统安装光盘到Kickstart服务器[root@localhost ~]# mkdir /kickstart[root@localhost ~]# mkdir /linuxinstall[root@localhost ~]# mkdir /tftpboot [root@localhost ~]# mkdir /tftpboot/pxelinux.cfg [root@localhost /]# mount /dev/cdrom /linuxinstall[root@localhost /]# vim /etc/fstab                    ......           /dev/cdrom     /linuxinstall    iso9660 defaults    0 0                     ......2、设置yum仓库源 [root@localhost ~]# cp /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/kickstart.repo [root@localhost ~]# vim /etc/yum.repos.d/kickstart.repo                    ......                    [kickstart]                     name=CentOS-$releasever - Media                    baseurl=file:///linuxinstall                    gpgcheck=0                    enabled=1                     ......3、安装Kickstart需要的组件 [root@localhost ~]# yum install nfs* dhcp tftp* system-config-kickstart –y4、设置nfs[root@localhost ~]# vim /etc/exports                    ......                    /linuxinstall    *(ro,sync)                    /kickstart       *(ro,sync)                    /tftpboot        *(ro,sync)                    ......[root@localhost /]# exportfs -rvexporting *:/linuxinstallexporting *:/kickstartexporting *:/tftpboot5、设置tftp[root@localhost /]# vim /etc/xinetd.d/tftp                    ......                    disable                    = no(yes改成no)                    ......6、配置DHCP[root@localhost ~]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf [root@localhost ~]# vim /etc/dhcpd.conf                    ......                    ddns-update-style interim;                    ignore client-updates;                    allow booting;                    allow bootp;                    subnet 192.168.159.0 netmask 255.255.255.0 {                    option routers                192.168.159.2;                    option subnet-mask            255.255.255.0;                           next-server 192.168.159.10;                    filename "pxelinux.0";                    range dynamic-bootp 192.168.159.128 192.168.159.254;                                default-lease-time 21600;                                max-lease-time 43200;                    }                    ......7、配置ks.cfg文件#platform=x86, AMD64, 或 Intel EM64T# System authorization informationauth --useshadow --enablemd5 # System bootloader configurationbootloader --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all --initlabel # Use graphical installgraphical# Firewall configurationfirewall --enabled   # Run the Setup Agent on first bootfirstboot --disable# System keyboardkeyboard us# System languagelang en_US# Installation logging levellogging --level=info# Use NFS installation medianfs --server=192.168.159.10 --dir=/linuxinstall# Network informationnetwork --bootproto=dhcp --device=eth0 --onboot=on# Reboot after installationreboot#Root passwordrootpw --iscrypted $1$9G/AkkmG$NtrFgqOQ4nAP.EUMXmxTP0# SELinux configurationselinux --enforcing# Do not configure the X Window Systemskipx# System timezonetimezone America/New_York# Install OS instead of upgradeinstall# Disk partitioning informationpart / --bytes-per-inode=4096 --fstype="ext3" --size=6000part /boot --bytes-per-inode=4096 --fstype="ext3" --size=600part swap --bytes-per-inode=4096 --fstype="swap" --size=1000%packages@base@chinese-support@core@dialup@editors@gnome-desktop@games@graphical-internet@graphics@office@printing@sound-and-video@text-internet@base-xkeyutilstrousersfipscheckdevice-mapper-multipathlibsane-hpaioxorg-x11-server-Xnest8、配置支持pxe启动[root@localhost ~]# cp ks.cfg /kickstart/ [root@localhost ~]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ [root@localhost ~]# cp /linuxinstall/images/pxeboot/vmlinuz /tftpboot/ [root@localhost ~]# cp /linuxinstall/images/pxeboot/initrd.img /tftpboot/ [root@localhost ~]# cp /linuxinstall/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default [root@localhost ~]# chmod a+r /tftpboot/pxelinux.cfg/default [root@localhost ~]# vim /tftpboot/pxelinux.cfg/defaultdefault linuxprompt 1timeout 60display boot.msglabel linux kernel vmlinuz append ks=nfs:192.168.159.10://kickstart/ks.cfg initrd=initrd.img label text kernel vmlinuz append initrd=initrd.img text label ks kernel vmlinuz append ks initrd=initrd.imglabel local localboot 1label memtest86 kernel memtest append -9、启动服务[root@localhost /]# service dhcpd restart[root@localhost /]# chkconfig dhcpd on[root@localhost /]# service nfs restart[root@localhost /]# chkconfig nfs on[root@localhost /]# service xinetd restart[root@localhost /]# chkconfig xinetd on10、测试在Linux使用ext2resize在线扩展文件系统Linux内核升级及内核编译相关资讯      kickstart 
  • Linux运维自动化工具 Kickstart  (04月09日)
  • Nginx DHCP TFTP Kickstart搭建自  (10/29/2015 10:38:15)
  • Kickstart 全自动安装部署RHEL 7.0  (09/20/2015 09:02:26)
  • PXE+Kickstart实现无人值守批量安  (11/11/2015 08:39:04)
  • RHCSA 系列(十二): 使用   (10/02/2015 19:53:58)
  • PXE+Kickstart实现自动安装CentOS   (09/12/2015 18:25:42)
本文评论 查看???部评论 (0)
表情: 姓名: 字数