Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1802082
  • 博文数量: 334
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 10:19
个人简介

路虽弥,不行不至;事虽少,不做不成。

文章分类

全部博文(334)

文章存档

2013年(4)

2012年(19)

2011年(27)

2010年(71)

2009年(45)

2008年(15)

2007年(84)

2006年(69)

分类: LINUX

2007-03-14 14:57:51

RedHat Troubleshooting汇总

前提条件

 showmount -e server1 (查看服务器上导出的安装目录)

     导出文件系统   /xxx

 mount -t nfs server1:/xxx  /mnt

关键词

    查看日志文件/var/log/messages    /var/log/secure

                 

 一.MBR错误                   

    情况描述:开机后BIOS自检通过后黑屏无任何提示。

        施:rescue模式重装grub  (grub-install  /dev/hdax)               

 二.grub错误

    1grub.conf语法有误    

        title  Redhat AS 4

        root (hda,0) (位置是不是对?)

        kernel /vmlinuz-2.6.9-42.EL ro root=/dev/hda4 rhgb quiet (位置是不是对?)

        initrd /initrd-2.6.9-42.img  (如果没有,或没有/initrd都可能会出错)

    2grub丢失

       grub-install  /dev/hdax

    3initrd-$(uname -r).img  文件丢失

       mkinitrd  initrd-$(uname -r).img    $(uname -r)               

    4initrd目录

       initrd目录主要为initrd-2.6.9-42.img服务的     

                

 三./etc/inittab错误  (man inittab, rpm -ivh  initscripts*.rpm  )          

 

    1.记住这四行 (如果记不住,见2)

      id:3:initdefault:

      (注意可能写成 id:0:initdefault: {开机就关机}

                    id:6:initdefault: {反复重启}

      si: :sysinit:/etc/rc.d/rc.sysinit

      13:3:wait:/etc/rc.d/rc 3 

      (注意可能写成 13:3:wait:/etc/rc.d/rc 0 {开机就关机}

                   13:3:wait:/etc/rc.d/rc 6 {反复重启})

      13:3:respawn:/sbin/mingetty tty1

(注意开启的是哪个终端,可联想/etc/securetty中的定义)

 

    2man inittab (如果还不行见3)

      man inittab,帮助完成上面四行

 

    3rescue模式重装包initscripts    

      先查看server1导出目录/xxx,然后mount挂载server1:/xxx到本地

      eg  mount -t nfs server1:/xxx /mnt   

    

      然后再安装,进入/mnt下含有initscripts包的这级目录

      rpm -ivh --force --aid initscripts*.rpm            

 

               

 四./etc/fstab错误

   1.出现WARNING:coundn't open /etc/fstab: No such file or directory {/etc/fstab文件丢失}

     /etc/fstab文件不属于任何rpm包,利用fdiske2label命令查看根分区(/分区),/boot , /home , /usr ,/var分区(如果有这几个分区),然后编辑/etc/fstab文件,注意fstab文件的格式,

  

  fdisk -l /dev/hda  查看分区情况;

  e2label  /dev/hdax 查看分区卷标;

   --------------------------------------------------------------------------------------------------------

   卷标/设备名     挂载点      文件类型       参数       备份       检查

 

注意/分区的检查先检查(1),其它后检查(2)

 

   如果不是在rescue模式,修改fstab文件时出来Read-only file system咋办?重新装载成读写模式mount -o remount,rw /dev/sdax /

 

   2mount文件丢失或被替换

mount 文件错误会出现/proc文件相关错误,红字显示很醒目,

此时比较麻烦,需进入rescue模式而不是进入输入root口令进行修改,因为根分区现在被

mount成只读(ro)模式,你没有mount命令来把根分区mount 成读写的(rw)

 

  3quota设置错误

    大不了把/etc/fstab中的usrquotagrpquota全部关闭。

               

 五.X-window错误   

1/home目录 /目录 /tmp目录空间满

  启动x时,要在/home /tmp下写文件,查看磁盘空间

  df  -m  (查看分区是不是有100%)

      du -m -a /home  |sort -nr |less  (查看目录下是不是在大文件)

2/home做了磁盘配额

  关闭磁盘配额:修改fstab,删除usrquotagrpquota

                mount  -o remountrw /home

3X-window没有配置

   system-config-display 配置X-window

 

4.文件系统不可写

   mount |grep \(ro\)  查找是不是有只读文件系统

 

5.字体服务器xfs有运行或没有安装

   rpm –ivh xorg-x11-xfs*.rpm (如果没有安装则安装)

   chkconfig –level 345 xfs on

   service xfs restart

 

 六.root不能正常登录             

(一)密码相关

 1.如是密码错误 单用户模式修改

 2root用户被锁 单用户模式 usermod -U root 即可

 3.没有root用户,即没有uid0的用户

 4.密码过期,则修改/etc/shadow

 5/etc/passwd中,root用户shell是不是/bin/bash(可能或是/bin/nologin)

 6.配置文件中含有logout等命令,/etc/profile , /etc/bashrc, ~/.bash_profile, ~/.bashrc

 7/etc/securetty文件中没有tty**表示1,2,3,4等)

 

(二)pam授权相关

 1.检查/etc/pam.d/system-auth文件

 

 2.检查/etc/pam.d/login文件

 

七.网络相关

   1.网络有没有配置

       netconfig

   2/etc/hosts/etc/resolv.conf/etc/host.conf

      /etc/hosts 定义主机

      /etc/resolv.conf 指定解析

      /etc/host.conf查找顺序

 

八.服务相关

-------------------------------------------------------------------

1apache

  httpd -t 测试配置文件

2samba

  testparm 测试配置文件

3nfs

  showmount -e localhost 看自己是否正常提供了exports

  rcpinfo -p localhost   portmap 是否正常

9bind

  named-checkconf   named-checkzone检查配置文件

 

 

阅读(2483) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~