第7周作业

本文详细介绍了如何使用kickstart文件自动化安装CentOS系统,包括制作kickstart文件的步骤和安装时指定文件的方法。此外,还分享了实现PXE网络安装CentOS6和CentOS7的全过程,包括配置DHCP服务、启动相关服务、准备yum源、kickstart应答文件以及PXE相关文件的设置。通过这些步骤,可以便捷地进行多系统的网络安装。
  1. 使用 kickstart 半自动化安装CentOS系统

    分两步:第一步制作kickstart文件,第二在安装时指定kickstart文件

    • 制作kickstart文件

      • centos7 kickstart文件
      #platform=x86, AMD64, or Intel EM64T
      #version=DEVEL
      # Install OS instead of upgrade
      ignoredisk --only-use=sda
      install
      # Keyboard layouts
      keyboard 'us'
      # Root password
      rootpw --iscrypted $1$soUjfIEK$vYPh2zadx6by9t2ingDyy.
      # System language
      lang en_US
      # System authorization information
      auth  --useshadow  --passalgo=sha512
      # Use text mode install
      text
      # SELinux configuration
      selinux --disabled
      # Do not configure the X Window System
      skipx
      
      
      # Firewall configuration
      firewall --disabled
      # Reboot after installation
      reboot
      # System timezone
      timezone Asia/Shanghai
      # Use network installation
      url --url="http://172.16.135.203/centos7/"
      # System bootloader configuration
      bootloader --location=mbr
      # Clear the Master Boot Record
      zerombr
      # Partition clearing information
      clearpart --all --initlabel --drives=sda
      # Disk partitioning information
      part /boot --fstype="xfs" --ondisk=sda --size=1024
      part pv.159 --fstype="lvmpv" --ondisk=sda --size=18432
      volgroup centos --pesize=4096 pv.159
      logvol swap  --fstype="swap" --size=2048 --name=swap --vgname=centos
      logvol /  --fstype="xfs" --size=16000 --name=root --vgname=centos
      
      %packages
      @base
      @core
      bash-completion
      tree
      %end
      
      %post
      date > /root/install_time.txt
      %end
      

      kickstart可以使用 system-config-kickstart 工具生成(需要安装), 也可以使用系统安装时生成的/root/anaconda-ks.cfg文件

      应答文件制作好后,放到web服务器上(方便修改安装时的选项,如果是刻录到光盘文件中,修改将会非常麻烦)

      需要注意的是,如果是centos7,在使用 system-config-kickstart 工具制作kickstart文件时,可能会出现以下qing’kuang

      [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6i1nOEwj-1601435145579)(https://s3-us-west-2.amazonaws.com/secure.notion-static.com/814e43a1-2c57-44c4-9614-dfe2ca3efaec/Untitled.png)]

      解决方法是:修改增加或修改一个yum源为development,如下

      [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-VhZ27IJ9-1601435145590)(https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bd9494a1-5bf6-440f-a1c8-b69f9cdbc35a/Untitled.png)]

      手工修改的kickstart文件后,可以使用ksvaildator 应答文件来检查是否有语法错误

    • 安装时指定kickstart文件

      1. 进入安装界面后,按下esc键,进入boot命令模式

      2. 输入:linux ks=应答文件存放位置,比如:linux http://172.168.135.201:/ksidr/ks_7.cfg

        存放在网络上的话,因为要联网才能拿到应答文件,所以需要配置网络。配置网络可以boot命令模式中指定,linux ks=应答文件存放位置 ip=xxx netmask=xxx gateway=xxx。也可以不指定,系统会在安装时自动获取IP地址。

        指定kickstart文件也可以在进入安装界面按下tab键,直接输入kickstart文件位置。如:linux http://172.168.135.201:/ksidr/ks_7.cfg

      3. 指定完成后,直接回车等待安装完成即可

  2. 实现pxe安装双系统centos6、centos7

    安装前准备:

    关闭防火墙和SELINUX,为DHCP服务器静态IP(如果使用的虚拟机,网卡的连接方式选择NAT为佳。因为选择桥接的话,很可能物理网络中还有别的DHCP服务器,容易出现冲突)

    1. 安装软件包,并启动httpd tftp-server dhcp服务

      yum -y install httpd tftp-server dhcp syslinux system-config-kickstart

      httpd:存放yum仓库和kickstart文件

      tftp-server:简化版的文件传输服务,之所以需要使用它,是因为网卡中一般都会继承tftp-client

      dhcp:用于为要安装的机器分配IP地址,和传输启动文件pxelinux.0

      syslinux:一些文件由这个包提供,pxelinux.0这个文件来自这个包

      system-config-kickstart:生成kickstart文件

    2. 配置dhcp服务,并启动httpd tftp-server dhcp服务

      dhcp服务配置如下:

      subnet 192.168.3.0 netmask 255.255.255.0 {
        range 192.168.3.10 192.168.3.20;
        option routers 192.168.3.1;
        next-server 192.168.3.2;
        filename "pxelinux.0";
      }
      

      systemctl start httpd tftp-server dhcpd

    3. 准备yum源,也就是将相应的系统安装包放到httpd的网页目录下

      mount /dev/sr0 /var/www/html/centos/7 sr0为centos7的光盘,sr1为centos6的光盘

      mount /dev/sr1 /var/www/html/centos/6

    4. 准备kickstart应答文件,并放入httpd的网页目录下

      • ks6_min.cfg
      • ks7_min.cfg
      Centos7root@Wed Feb 19 html]# tree ksdir
      ksdir
      └── 6
      		└── ks6_min.cfg
      └── 7
          └── ks7_min.cfg
      
    5. 准备PXE相关文件

      • 需要切换到tftp-server的工作目录:/var/lib/tftpboot

      复制pxelinux.0文件:cp /usr/share/syslinux/pxelinux.0 .

      从系统光盘中拷贝内核文件(vmlinuz)和虚拟文件系统文件(initrd.img)

      拷贝菜单风格文件menu.c32:cp /usr/share/syslinux/menu.c32 .

      从光盘中拷贝启动菜单配置文件:cp /var/www/html/centos/7/isolinux/isolinux.cfg pxelinux.cfg/default,并修改defaul文件如下:

      default menu.c32
      timeout 600 
      
      menu title CentOS 7
      
      label desktop
        menu label Install min CentOS ^6
        kernel vmlinuz
        append initrd=initrd.img ks=http://192.168.3.2/ksdir/7/ks6_min.cfg
      
      label mini
        menu label  Install mini CentOS ^7
        kernel vmlinuz
        append initrd=initrd.img ks=http://192.168.3.2/ksdir/7/ks7_min.cfg
      
      label local
        menu default
        menu label Boot from ^local drive
        localboot 0xffff
      
      menu end
      
    6. 重启tftp服务:systemctl start tftpd

    7. 至此配置完成,只需要安装机器的时候选择从网络安装就能自动安装了(在BIOS界面中选择)

WIN7 X64 PDF缩略图 补丁软件 Introduction: This page contains simple fixes for Adobe's PDF preview handler and thumbnails on 64-bit versions of Windows. Before I looked into this, people had been complaining about it for over two years with no official response. Only the thumbnails fix is still needed, except if you upgraded from Vista to Windows 7, where both fixes may still be needed. Half a year after I published the information, Adobe finally incorporated the preview handler fix (but no thumbnails fix, and they leave the preview handler broken if you upgraded from Vista to Windows 7) into the installer for Adobe Reader 9.3.2 (April 2010). Maybe in 2011 Adobe will manage to fix the thumbnails as well; until then you can get my fix for them below. :-) Preview Handler Preview handlers are lightweight components which let you view various file types within programs like Windows Explorer (in Windows Vista and Windows 7), Outlook 2007/2010 and Directory Opus (via my bundled plugin). Adobe Reader comes with Adobe's PDF preview handler but the installer had a mistake which meant the preview handler did not work on 64-bit systems. It turned out the problem could be fixed via a simple registry change. The change is described below and a small program which performs the fix is also provided for your convenience. Unlike the thumbnail fix, described below, the preview handler fix should no longer be needed by most people, since Adobe have finally fixed their installer, but it's still provided in case it helps repair things. If you had Adobe Reader installed under Vista and later upgraded to Windows 7 then you will probably still need to run the preview handler fix once to clean up a registry value which Adobe set inconsistently between the two OS versions. If in doubt, run the fix and it will tell you if anything needs to be done. If everything is good already then the preview handler fix won't change anything.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值