give root password for maintenance 启动异常的解决

问题:

centos重启后,无法正常ssh登陆,也无法ping通,实地操作出现如下提示:

输入登陆密码,重启sshd服务,出现提示“read-only file system”,重启network服务问题依旧:

 

分析:

结合以上两点信息,大致可以判断出现这种问题有几种原因:1硬盘坏了;2硬件不兼容;3人为操作改动;

 

解决办法:

1尝试ssh登陆服务器:

启动ssh相关服务,即network 、sshd ,即使有错误提示,服务依然可以被成功启动,不影响使用

 

2登陆crt查看开机服务与服务端口状态:

使用chkconfig查看本地服务,没有异常;但是使用netstat 查看本地服务端口,发现是全部关闭的;

 

3进行磁盘修复:

使用fsck检查和维护不一致的文件系统,点选“yes”  

[root@Centos ~]# fsck
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/sda2 contains a file system with errors, 强制检查.
第一步: 检查inode,块,和大小
第二步: 检查目录结构
第3步: 检查目录连接性
Pass 4: Checking reference counts
第5步: 检查簇概要信息
块位图差异: -(561863--561885) -(1096960--1097067) -(1116272--1116512) -(1117898--1118374) -(1642496--1642506) -1648639 -(2218497--2218498) -2218500 -2218605 -2218608
处理<y>? 是

Free 块s count wrong for 簇 #17 (22913, counted=22936).
处理<y>? 是

Free 块s count wrong for 簇 #33 (0, counted=108).
处理<y>? 是

Free 块s count wrong for 簇 #34 (0, counted=718).
处理<y>? 是

Free 块s count wrong for 簇 #50 (27079, counted=27091).
处理<y>? 是

Free 块s count wrong for 簇 #67 (14633, counted=14638).
处理<y>? 是

Free 块s count wrong (4465830, counted=4466696).
处理<y>? 是

Inode位图差异: -131475 -263939 -265119 -265121 -393388 -661151
处理<y>? 是

Free inodes count wrong for 簇 #16 (6455, counted=6456).
处理<y>? 是

Free inodes count wrong for 簇 #32 (0, counted=3).
处理<y>? 是

Free inodes count wrong for 簇 #48 (5, counted=6).
处理<y>? 是

Free inodes count wrong for 簇 #80 (0, counted=1).
处理<y>? 是

Free inodes count wrong (1172502, counted=1172508).
处理<y>? 是


/dev/sda2: ***** 文件系统已修改 *****
/dev/sda2: ***** 重新启动 LINUX *****
/dev/sda2: 72676/1245184 files (0.5% non-contiguous), 513784/4980480 blocks

 

4系统修复完毕,重启服务器,再次查看服务端口,恢复正常; 

[root@Centos ~]# netstat -luntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      966/rpcbind         
tcp        0      0 0.0.0.0:10000               0.0.0.0:*                   LISTEN      1165/perl           
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1038/sshd           
tcp        0      0 0.0.0.0:35702               0.0.0.0:*                   LISTEN      984/rpc.statd       
tcp        0      0 0.0.0.0:3128                0.0.0.0:*                   LISTEN      1121/(squid)        
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1062/sendmail       
tcp        0      0 0.0.0.0:873                 0.0.0.0:*                   LISTEN      1130/rsync          
tcp        0      0 :::111                      :::*                        LISTEN      966/rpcbind         
tcp        0      0 :::80                       :::*                        LISTEN      1096/httpd          
tcp        0      0 :::58067                    :::*                        LISTEN      984/rpc.statd       
tcp        0      0 :::22                       :::*                        LISTEN      1038/sshd           
tcp        0      0 :::873                      :::*                        LISTEN      1130/rsync          
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               966/rpcbind         
udp        0      0 0.0.0.0:10000               0.0.0.0:*                               1165/perl           
udp        0      0 0.0.0.0:34227               0.0.0.0:*                               1121/(squid)        
udp        0      0 0.0.0.0:717                 0.0.0.0:*                               966/rpcbind         
udp        0      0 0.0.0.0:37968               0.0.0.0:*                               984/rpc.statd       
udp        0      0 0.0.0.0:736                 0.0.0.0:*                               984/rpc.statd       
udp        0      0 :::111                      :::*                                    966/rpcbind         
udp        0      0 :::58520                    :::*                                    1121/(squid)        
udp        0      0 :::717                      :::*                                    966/rpcbind         
udp        0      0 :::59859                    :::*                                    984/rpc.statd  

  

 

posted @ 2015-02-16 11:27  daino  阅读(6129)  评论(0编辑  收藏  举报