grub引導修復(分區信息損壞)

grub引導故障(分區信息損壞)




查看grub信息


[root@test2 Desktop]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#  all kernel and initrd paths are relative to /boot/, eg.
#  root (hd0,0)
#  kernel /vmlinuz-version ro root=/dev/mapper/vg_jason-lv_root
#  initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_jason-lv_root rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_LVM_LV=vg_jason/lv_root rd_LVM_LV=vg_jason/lv_swap rd_NO_MD crashkernel=128M SYSFONT=latarcyrheb-sun16 rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-431.el6.x86_64.img

下面要寫入的就是這些內容:

  • root (hd0,0)

  • kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_jason-lv_root

  • initrd /initramfs-2.6.32-431.el6.x86_64.img

Red Hat Enterprise Linux 3: Reference Guide

  • root (<device-type><device-number>,) — Configures the root partition for GRUB, such as (hd0,0), and mounts the partition.

  • kernel </path/to/kernel> <option-1> <option-N> — Specifies the kernel file to load when booting the operating system. Replace </path/to/kernel> with an absolute path from the partition specified by the root directive. Multiple options can be passed to the kernel when it is loaded.

  • initrd </path/to/initrd> — Enables users to specify an initial RAM disk to use when booting. Replace </path/to/initrd> with the absolute path to the initial RAM disk.


通過更改grub.conf名稱模擬grub出錯


[root@test2 grub]# mv grub.conf grub.conf.bak
[root@test2 grub]# ls -lh | grep grub
-rw-------. 1 root root  819 May 18 04:15 grub.conf.bak
lrwxrwxrwx. 1 root root   11 May 18 04:13 menu.lst -> ./grub.conf
[root@test2 grub]#
[root@test2 grub]# reboot


根據gru.conf來手動寫入:

root+kernel


nscQ7HH.jpg


initrd


pcE9B5w.jpg


boot


1tvq1iC.jpg


重啓後正常進入桌面登錄


aLAxPff.jpg


將grub.conf.bak更改回grub.conf


[root@test2 grub]# mv grub.conf.bak grub.conf
[root@test2 grub]# ls -lh | grep grub.conf
-rw-------. 1 root root  819 May 18 04:15 grub.conf
lrwxrwxrwx. 1 root root   11 May 18 04:13 menu.lst -> ./grub.conf
[root@test2 grub]#




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章