你好,游客 登录 注册 搜索
背景:
阅读新闻

红帽企业版Linux 6安装指南(中文)

[日期:2012-12-05] 来源:51cto  作者:manual [字体:大 中 小]

六、无人值守安装的完整示例(实验环境RHEL6.2):
示例拓扑图如下:

注意事项:以下6.1、6.2、6.3的实验步骤在192.168.0.1(启动服务器)上操作。

6.1 DHCP服务:
[root@localhost ~]#yum install dhcp
[root@localhost ~]#cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
[root@localhost ~]#vim /etc/dhcp/dhcpd.conf 修改该文件后,内容如下

  1. # dhcpd.conf
  2. option domain-name "example.org";
  3. default-lease-time 600;
  4. max-lease-time 7200;
  5. log-facility local7;
  6. subnet 192.168.0.0 netmask 255.255.255.0 {
  7. range 192.168.0.100 192.168.0.200;
  8. option routers 192.168.0.1;
  9. next-server 192.168.0.1;
  10. filename "pxelinux.0";
  11. }
  12. host PXE {
  13. hardware ethernet 00:0C:29:7B:86:E1;
  14. fixed-address 192.168.0.1;
  15. }
  16. host install {
  17. hardware ethernet 00:0C:29:7B:86:A2;
  18. fixed-address 192.168.0.2;
  19. }


[root@localhost ~]#/sbin/service dhcpd restart
6.2 TFTP服务:
[root@localhost ~]#yum install tftp-server
[root@localhost ~]#vim /etc/xinetd.d/tftp 修改该文件后,内容如下

  1. service tftp
  2. {
  3. socket_type = dgram
  4. protocol = udp
  5. wait = yes
  6. user = root
  7. server = /usr/sbin/in.tftpd
  8. server_args = -s /var/lib/tftpboot
  9. disable = no
  10. per_source = 11
  11. cps = 100 2
  12. flags = IPv4
  13. }

[root@localhost ~]# /sbin/service xinetd restart
6.3 复制pxelinux.0以及Linux内核文件至TFTP共享目录:
[root@localhost ~]#yum install syslinux
[root@localhost ~]#cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@localhost ~]#mount /dev/cdrom /media 挂载红帽6.2安装光盘
[root@localhost ~]#cp /media/isolinux/{vmlinuz,initrd.img} /var/lib/tftpboot/
[root@localhost ~]#mkdir /var/lib/tftpboot/pxelinux.cfg
[root@localhost ~]#cp /media/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
[root@localhost ~]#vim /var/lib/tftpboot/pxelinux.cfg/default 修改该文件后,内容如下

  1. default linux
  2. prompt 0
  3. timeout 600
  4. display boot.msg
  5. menu background splash.jpg
  6. menu title Welcome to Red Hat Enterprise Linux 6.2!
  7. menu color border 0 #ffffffff #00000000
  8. menu color sel 7 #ffffffff #ff000000
  9. menu color title 0 #ffffffff #00000000
  10. menu color tabmsg 0 #ffffffff #00000000
  11. menu color unsel 0 #ffffffff #00000000
  12. menu color hotsel 0 #ff000000 #ffffffff
  13. menu color hotkey 7 #ffffffff #ff000000
  14. menu color scrollbar 0 #ffffffff #00000000
  15. label linux
  16. menu label ^Install or upgrade an existing system
  17. menu default
  18. kernel vmlinuz
  19. append initrdinitrd=initrd.img ks=nfs:192.168.0.2:/ks/ks.cfg

注意事项:以下6.4、6.5实验步骤在192.168.0.2(安装服务器)上操作
6.4 生成Kickstart文件:
yum安装system-config-kickstart软件,使用该软件生成Kickstart文件,使用方法见第五节内容。
生成Kickstart文件后保存至/ks目录下(该目录默认不存在,需要手动创建目录)
[root@localhost ~]#vim /ks/ks.cfg Kickstart文件内容如下

  1. #platform=x86, AMD64, or Intel EM64T
  2. #version=DEVEL
  3. # Firewall configuration
  4. firewall --disabled
  5. # Install OS instead of upgrade
  6. install
  7. # Use NFS installation media
  8. nfs --server=192.168.0.2 --dir=/media
  9. # Root password
  10. rootpw --iscrypted $1$k7gSaGFT$cRcT1X9SNOuEuvUHHkkAD0
  11. # System authorization information
  12. auth --useshadow --passalgo=sha512
  13. # Use text mode install
  14. text
  15. firstboot --disable
  16. # System keyboard
  17. keyboard us
  18. # System language
  19. lang en_US
  20. # SELinux configuration
  21. selinux --disabled
  22. # Installation logging level
  23. logging --level=info
  24. # Reboot after installation
  25. reboot
  26. # System timezone
  27. timezone Asia/Shanghai
  28. # Network information
  29. network --bootproto=static--device=eth0--gateway=192.168.0.1 --ip=192.168.0.201 --nameserver=202.106.0.20 --netmask=255.255.255.0 --onboot=on
  30. # System bootloader configuration
  31. bootloader --location=mbr
  32. # Partition clearing information
  33. clearpart --all --initlabel
  34. # Disk partitioning information
  35. part /boot --fstype="ext4"--size=200
  36. part swap --fstype="swap"--size=2000
  37. part /home --fstype="ext4"--size=500
  38. part /var --fstype="ext4"--size=2000
  39. part / --fstype="ext4"--size=5000
  40. %packages
  41. @base
  42. @basic-desktop
  43. @chinese-support
  44. @desktop-debugging
  45. @desktop-platform
  46. @fonts
  47. @general-desktop
  48. @graphical-admin-tools
  49. @input-methods
  50. @internet-browser
  51. @x11
  52. cjkuni-fonts-ghostscript
  53. cjkuni-fonts-ghostscript
  54. %end

6.5 NFS共享Kickstart文件与安装源(发布安装树)
[root@localhost ~]#mount /dev/cdrom /media 挂载红帽6.2安装光盘
[root@localhost ~]#vim /etc/exports 修改该文件后,内容如下

  1. /ks *(ro)
  2. /media *(ro)

[root@localhost ~]#/sbin/service nfs restart
6.6 该步骤在安装客户机操作,通过BIOS设置开机启动项为网络启动,重启电脑即可实现无人值守安装系统!

linux
相关资讯       红帽企业版Linux  RedHat Linux安装 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款