一,MBR故障排除:

1,准备另外一块磁盘或分区

服务器的开机故障排除及远程控制_故障排除

2,备份mbr扇区

[root@localhost~]# dd if=/dev/sda of=/date/sda.mbr bs=512 count=1

1+0 records in

1+0 records out

512 bytes (512B) copied, 0.010756 seconds, 47.6 kB/s

[root@localhost~]# ls /date/sda.mbr

/date/sda.mbr

3,模拟mbr扇区故障并重启

[root@localhost~]# dd if=/dev/zero of=/dev/sda bs=512 count=1

1+0 records in

1+0 records out

512 bytes (512B) copied, 1.3e-05 seconds, 39.4 MB/s

[root@localhost~]# reboot

4,启动故障

服务器的开机故障排除及远程控制_服务器_02

5,放入光盘bios设置cdrom启动,开机进入救援模式

服务器的开机故障排除及远程控制_故障排除_03

6,恢复备份的mbr文件

服务器的开机故障排除及远程控制_远程控制_04

7,mbr修复完毕

服务器的开机故障排除及远程控制_远程控制_05

拓展:mbr的修复方法(1)本机备份恢复(2)其他同时上线的服务器中拷mbr备份

二,grub.conf文件出错或丢失:

1,开机提示grub>

进行以下操作:

        grub>root hd0,0

        grub>kernel /vmlinuz-2.6.18-348.e15ro root=/dev/sda2

        grub>initrd/initrd-2.6.18-348.e15.img

        grub>boot

服务器的开机故障排除及远程控制_服务器_06

2,进入系统添加编辑grub.conf

# vim /boot/grub/grub.conf

timeout=5

default=0

title NSD1312 Linux Server

       root(hd0,0)

       kernel/vmlinuz-2.6.18-348.el5 ro [root=/dev/sda2]

       initrd/initrd-2.6.18-348.el5.img

扩展:grub故障恢复(1)从备份(2)自己编辑设置grub.conf文件

三,inittab文件丢失:

1,删除inittab文件,查看inittab文件的安装包,重启系统

[root@localhost ~]# rm -f /etc/inittab

[root@localhost ~]# rpm -qf /etc/inittab

initscripts-8.45.42-1.el5_8.1

服务器的开机故障排除及远程控制_服务器_07


2,放光盘进入救援模式重新强制安装inittab安装包

服务器的开机故障排除及远程控制_服务器_08

四,开机破解密码:

1,开机上下键调节进入内核模式

服务器的开机故障排除及远程控制_故障排除_09

2e进入查看模式

服务器的开机故障排除及远程控制_远程控制_10


3e进入编辑模式

服务器的开机故障排除及远程控制_远程控制_11

4,改完Enterb重启进入单用户模式

rhel5rhel6设置密码有所差别


服务器的开机故障排除及远程控制_故障排除_12

服务器的开机故障排除及远程控制_故障排除_13


五,远程控制实验:

1,服务端设置:

# vim /etc/ssh/sshd_config

服务器的开机故障排除及远程控制_故障排除_14

2,查看并重启ssh服务

[root@localhost ~]# chkconfig --list sshd

sshd           0:off   1:off   2:on   3:on    4:on    5:on   6:off

[root@localhost ~]# service sshd restart

Stopping sshd:                                            [  OK  ]

Starting sshd:                                            [  OK  ]


3Windows客户端验证:


服务器的开机故障排除及远程控制_服务器_15

登录成功

服务器的开机故障排除及远程控制_服务器_16



4,从另外一台Linux主机远程控制|服务端

[root@localhost ~]# ssh -p 8821 root@192.168.194.137

root@192.168.194.137's password:

Last login: Wed Feb 26 18:45:59 2014 from192.168.194.1

[root@localhost ~]# ifconfig eth0

eth0      Linkencap:Ethernet  HWaddr00:0C:29:47:5B:62  

         inetaddr:192.168.194.137  Bcast:192.168.194.255  Mask:255.255.255.0

         inet6addr: fe80::20c:29ff:fe47:5b62/64 Scope:Link

         UPBROADCAST RUNNING MULTICAST MTU:1500  Metric:1

         RXpackets:260 errors:0 dropped:0 overruns:0 frame:0

         TXpackets:195 errors:0 dropped:0 overruns:0 carrier:0

         collisions:0 txqueuelen:1000

         RXbytes:28705 (28.0 KiB)  TX bytes:29338(28.6 KiB)

5,把本地文件上传至服务端

[root@localhost ~]# exit

logout

Connection to 192.168.194.137 closed.


[root@localhost ~]# scp -P8821 install.logroot@192.168.194.137:/root/Desktop/test.file

root@192.168.194.137's password:

install.log                                 100%  31KB  31.3KB/s   00:00  

服务器的开机故障排除及远程控制_远程控制_17



6,从服务端下载文件

[root@localhost ~]# scp -P8821root@192.168.194.137:/root/Desktop/test.file/root/Desktop/

root@192.168.194.137's password:

test.file                                         100%   31KB  31.3KB/s  00:00  

服务器的开机故障排除及远程控制_故障排除_18

7,利用ftp访问服务端

[root@localhost ~]# sftp-oPort=8821root@192.168.194.137

Connecting to 192.168.194.137...

root@192.168.194.137's password:

sftp> cd /

sftp> ls

bin         boot         dev          etc          home         lib          

lib64       lost+found   media        misc         mnt          net          

opt         proc         root         sbin         selinux      srv          

sys         tftpboot     tmp          usr          var