Trouble shooting笔记

启动非挂载模式
kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet emergency


重新挂载:
mount -o remount,rw /


修复这两个文件:
/etc/fstab /etc/mtab


mount /dev/hda1 /mnt/runtime/

chroot /mnt/runtime/

e2lable /dev/sda1

vim /etc/fstab

/dev/sda1 /boot ext3 defaults 1 2
/dev/sda2 / ext3 defaults 1 1
/dev/sda3 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
tmpfs /tmp tmpfs defaults 0 0




修复mount命令:
chroot /mnt/sysimage
rpm -qf /bin/mount
whereis mount
rpm -qf /user/share/man/man8/mount.8.gz

exit
cd /mnt/source/Server
rpm -ivh util-linux-24332.rpm --root=/mnt/sysimage/ --force
chroot /mnt/sysimage

mount




grub

修复引导扇区:
dd if=/dev/zero of=/dev/sda bs=446 count=1 #破坏引导扇区

修复grub:
chroot /mnt/sysimage
grub-install /dev/sda1 #除了/boot/grub/grub.conf都能修复
vim /boot/grub/grub.conf

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-164.el5.img

chroot /mnt/sysimage
grub-install /dev/sda #修复MBR


kernel修复
rpm -ivh /mnt/source/Server/kernel-2.6.18-164.el5.i686.rpm -root /mnt/sysimage/ --force
ls命令修复
rpm -ivh /mnt/source/Server/coreutils-5.97-23.el5.i386.rpm --root /mnt/sysimage/ --force
mount命令修复
rpm -ivh /mnt/source/Server/untils-324.rpm --root /mnt/sysimage/ --force


你可能感兴趣的:(职场,休闲,trouble,shooting笔记)