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

Linux配置网络rescue mode

[日期:2012-08-09] 来源:Linux社区  作者:GangLin_Lan [字体:大 中 小]

Linux遇到严重的系统故障时,就需要用Linux的rescue mode进入系统进行修复,假如要修复对象的机器没光驱呢,就不能从光盘进入rescue了,而且随身带着光盘也麻烦,试想一下在笔记本上配一个各个系统版本的rescue,到时候只要网线一连,就能进入rescue进行修复了。

在网络上有很多关于kickstart+dhcp+dns+vsftp++tftp+pxe的网络自动安装文档,其实网络rescue原理也一样。

一:dhcp配置

安装dhcp(略)

  1. [root@server2 ~]# vim /etc/dhcpd.conf
  2. ddns-update-style none;
  3. subnet 192.168.238.0 netmask 255.255.255.0 {
  4. option routers 192.168.238.1;
  5. option subnet-mask 255.255.255.0;
  6. option domain-name "example.com";
  7. default-lease-time 21600;
  8. max-lease-time 43200;
  9. pool {
  10. range 192.168.238.2 192.168.238.99;
  11. }
  12. next-server server2.lanv.com;
  13. }
  14. option space PXE;
  15. class "PXE" {
  16. match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
  17. option vendor-encapsulated-options 01:04:00:00:00:00:ff;
  18. option boot-size 0x1;
  19. filename "pxelinux.0";
  20. option tftp-server-name "server2.lanv.com";
  21. option vendor-class-identifier "PXEClient";
  22. vendor-option-space PXE;
  23. }
  24. [root@server2 ~]# service dhcpd restart
  25. Shutting down dhcpd: [ OK ]
  26. Starting dhcpd: [ OK ]

二:配置vsftp
安装略

  1. [root@server2 ~]# cd /var/ftp/pub/
  2. [root@server2 pub]# mkdir RHEL5.7

把rhel5.7光盘内容都cp到/var/ftp/pub/RHEL5.7里

  1. [root@server2 pub]# service vsftpd start
  2. Starting vsftpd for vsftpd: [ OK ]
  3. [root@server2 pub]# chkconfig vsftpd on

三:配置tftp
启用tftp

  1. [root@server2 Oracle]# vim /etc/xinetd.d/tftp
  2. service tftp
  3. {
  4. socket_type = dgram
  5. protocol = udp
  6. wait = yes
  7. user = root
  8. server = /usr/sbin/in.tftpd
  9. server_args = -s /tftpboot
  10. disable = no
  11. per_source = 11
  12. cps = 100 2
  13. flags = IPv4
  14. }
  15. [root@server2 oracle]# service xinetd restart
    Stopping xinetd:                                           [  OK  ]
    Starting xinetd:                                           [  OK  ]

拷贝以下文件到/tftpboot目录

  1. [root@server2 isolinux]# df -h /mnt
  2. Filesystem Size Used Avail Use% Mounted on
  3. /dev/hdc 3.6G 3.6G 0 100% /mnt
  4. [root@server2 mnt]# cd isolinux/
  5. [root@server2 isolinux]# ls
  6. boot.cat general.msg isolinux.bin memtest param.msg splash.lss vmlinuz
  7. boot.msg initrd.img isolinux.cfg options.msg rescue.msg TRANS.TBL
  8. [root@server2 isolinux]# cp boot.msg /tftpboot/
  9. [root@server2 isolinux]# cp initrd.img /tftpboot/initrd-5.7.img
  10. [root@server2 isolinux]# cp -r isolinux.cfg /tftpboot/default
  11. [root@server2 isolinux]# cp vmlinuz /tftpboot/vmlinuz-5.7
  12. [root@server2 isolinux]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
  13. [root@server2 isolinux]# cd /tftpboot/
    [root@server2 tftpboot]# mkdir pxelinux.cfg
    [root@server2 tftpboot]# mv default pxelinux.cfg/
  14. [root@server2 tftpboot]# ls
    boot.msg  initrd-5.7.img  pxelinux.0  pxelinux.cfg  vmlinuz-5.7
linux
相关资讯       Linux服务器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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