重新安装windows后引导centos系统

机器有两个系统,windows和centos,重新安装了一下windows,这时候就找不到centos了,需要重新引导:

方法是这样的:
1:插入centos安装盘,从光盘启动;
   然后在root命令行输入:“linux rescue”,回车:

2、光盘系统会自动检测硬盘上原有的系统,如果检测成功,会给与相应的提示,(如果检测不成功,说明你的分区表坏了)

3、选择“continue”,以读写模式挂载原有文件系统到/mnt/sysimage下,这时候系统会提示你通过“chroot /mnt/sysimage”将根目录切换到原有文件系统的根部:

4、修复gurb:
sh-3.1# chroot /mnt/sysimage
sh-3.1# grub
grub> root (hdX,Y)
grub> setup (hdX)
grub> quit
sh-3.1# exit


注意2:
其中的X、Y是执行find /boot/grub/stage1命令后系统提示的。比如下面这种情况,X就是0,Y就是7。:
grub> find /boot/grub/stage1 (hd0,7) stage1 后面是1,123的1
注意3:如果find命令,没返回可用的结果,那就是/boot单独在一个分区中,用下面的命令可得到:
grub> find /grub/stage1

猜你喜欢

转载自xiaoyi829.iteye.com/blog/835299