boot目录被删除如何修复

  • A+
所属分类:运维教程

1.使用光盘引导,进入救援模式

2.如果可以挂载根分区则请跳至第8步,否则请手工挂载根分区,可运行下列命令找到根分区

# fdisk -l

3.创建挂载目录

# mkdir /mnt/sysimage

4.挂根分区(假如第2步找到的分区是/dev/sda2)

# mount /dev/sda2 /mnt/sysimage

5.将根分区挂载目录设成磁盘中根目录,之前根目录是在光盘中

# chroot /mnt/sysimage

6.创建或恢复fstab文件

# vi /etc/fstab

7.重启

# reboot

8.进入救援模式,切换到根目录

# chroot /mnt/sysimage

9.手动挂载光盘

# mount /dev/sr0 /media

10.安装内核文件

# rpm -ivh /media/Packages/kernel-2.6.32-573.el6.x86_64.rpm --root=/ --force

11.安GRUB

# grub-install /dev/sda

12.修复或重建grub.conf文件

# vi /boot/grub/grub.conf

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux 6 (2.6.32-573.el6.x86_64)

root (hd0,0)

kernel /vmlinuz-2.6.32-573.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=128M LANG=zh_CN.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet

initrd /initramfs-2.6.32-573.el6.x86_64.img

13.卸载光盘

# umount /media

14.重启

# reboot

  • 问答中心
  • 微信小程序扫一扫
  • weinxin
  • 微信公众
  • 微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:22   其中:访客  22   博主  0

    • avatar Cialis generic cialis

      Thanks so much for the post.Really thank you! Great.https://discocia.com/

      • avatar grolyrtolemcs

        At this time it seems like BlogEngine is the top blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?