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 splashp_w_picpath=(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
initrd
boot
重启后正常进入桌面登录
将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]#
转载于:https://blog.51cto.com/zencode/1791502