起初本机安装的win7+centos6.5双系统
后来win7升级为win10后,导致centos进不去了
解决方法:
重装一遍grub,因为centos安装的分区没有任何改变,因此只需重新安装即可
首先使用centos光盘或者U盘启动后,进入linux rescue模式,如果使用U盘,相当如多了一块硬盘,因此有可能变为hdb
#chroot /mnt/sysimages/ //进入系统
#grub-install /dev/hda //安装grub,因为grub没有丢失,这一步应该不需要做
接着安装grub,但是centos还是不能进入,
grub>root (hd0,2) //设置根分区在磁盘的位置,root (hd0,2) , hd0表示第一块硬盘,2表示该硬盘的第3个主分区,表示根分区的位置,这两个变量需要输入正确。
使用U盘启动后可能变成hd1,但是grub.conf不需要改变
grub>setup (hd0) //
将引导文件写入磁盘,比如把stage1写入hd0即第一个磁盘的1号分区,第一个扇区的位置;其实就是自动安装grub
在这里退出到bash模式后重启就应该可以了
如果还不可以的话,可以修改/boot/grub/grub.conf
(这一步应该不需要执行)
配置如下(注意红色字体):
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb irqpoll quiet
initrd /boot/initrd-2.6.18-194.el5.img
title Other
rootnoverify (hd0,0)
chainloader +1
default=0
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb irqpoll quiet
initrd /boot/initrd-2.6.18-194.el5.img
title Other
rootnoverify (hd0,0)
chainloader +1