Linux配置网络rescue mode

Linux大全评论785 views阅读模式

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
  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  ]
  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

企鹅博客
  • 本文由 发表于 2020年9月27日 19:01:20
  • 转载请务必保留本文链接:https://www.qieseo.com/154248.html

发表评论