Linux配置网络rescue mode

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

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

一:dhcp配置

安装dhcp(略)

[root@server2 ~]# vim /etc/dhcpd.conf ddns-update-style none; subnet 192.168.238.0 netmask 255.255.255.0 { option routers 192.168.238.1; option subnet-mask 255.255.255.0; option domain-name "example.com"; default-lease-time 21600; max-lease-time 43200; pool { range 192.168.238.2 192.168.238.99; } next-server server2.lanv.com; } option space PXE; class "PXE" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; option vendor-encapsulated-options 01:04:00:00:00:00:ff; option boot-size 0x1; filename "pxelinux.0"; option tftp-server-name "server2.lanv.com"; option vendor-class-identifier "PXEClient"; vendor-option-space PXE; } [root@server2 ~]# service dhcpd restart Shutting down dhcpd: [ OK ] Starting dhcpd: [ OK ]

二:配置vsftp
安装略

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

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

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

三:配置tftp
启用tftp

[root@server2 Oracle]# vim /etc/xinetd.d/tftp service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } [root@server2 oracle]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

拷贝以下文件到/tftpboot目录

[root@server2 isolinux]# df -h /mnt Filesystem Size Used Avail Use% Mounted on /dev/hdc 3.6G 3.6G 0 100% /mnt [root@server2 mnt]# cd isolinux/ [root@server2 isolinux]# ls boot.cat general.msg isolinux.bin memtest param.msg splash.lss vmlinuz boot.msg initrd.img isolinux.cfg options.msg rescue.msg TRANS.TBL [root@server2 isolinux]# cp boot.msg /tftpboot/ [root@server2 isolinux]# cp initrd.img /tftpboot/initrd-5.7.img [root@server2 isolinux]# cp -r isolinux.cfg /tftpboot/default [root@server2 isolinux]# cp vmlinuz /tftpboot/vmlinuz-5.7 [root@server2 isolinux]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ [root@server2 isolinux]# cd /tftpboot/
[root@server2 tftpboot]# mkdir pxelinux.cfg
[root@server2 tftpboot]# mv default pxelinux.cfg/ [root@server2 tftpboot]# ls
boot.msg  initrd-5.7.img  pxelinux.0  pxelinux.cfg  vmlinuz-5.7

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/9158a7176ac49c316551a689abe7cc8b.html