环境:win7 + ubuntu12.04
原因:ubuntu引导不识别win7系统,胡乱执行grub修复,导致双系统均无法启动。
出现异常信息:no boot signature in partition。
解决:
1. 通过USB系统镜像启动ubuntu。制作镜像。
2. 设置你的bios为USB启动,进入ubuntu。
3. 在线安装lilo。
ubuntu@ubuntu:~$ sudo apt-get install lilo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mbr
Suggested packages:
lilo-doc
The following NEW packages will be installed:
lilo mbr
0 upgraded, 2 newly installed, 0 to remove and 408 not upgraded.
Need to get 413kB of archives.
After this operation, 1,315kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirror.bjtu.edu.cn/ubuntu/ lucid/main mbr 1.1.10-2 [23.0kB]
Get:2 http://mirror.bjtu.edu.cn/ubuntu/ lucid/main lilo 1:22.8-8ubuntu1 [390kB]
Fetched 413kB in 3s (124kB/s)
Preconfiguring packages ...
Selecting previously deselected package mbr.
(Reading database ... 129801 files and directories currently installed.)
Unpacking mbr (from .../archives/mbr_1.1.10-2_i386.deb) ...
Selecting previously deselected package lilo.
Unpacking lilo (from .../lilo_1%3a22.8-8ubuntu1_i386.deb) ...
Processing triggers for man-db ...
Setting up mbr (1.1.10-2) ...
Setting up lilo (1:22.8-8ubuntu1) ...
WARNING: kernel & initrd not found in the root directory (/vmlinuz & /initrd.img)
WARNING: Do NOT reboot or LILO may fail to boot if your kernel+initrd is large.
WARNING: Please read /usr/share/doc/lilo/README.Debian
ubuntu@ubuntu:~$
安装过程中,会得到如下lilo的配置提示,按OK就行了:
Package configuration
┌───────────────────────────┤ Configuring lilo ├────────────────────────────┐
│ │
│ LILO configuration │
│ │
│ It seems to be your first LILO installation. It is absolutely necessary │
│ to run liloconfig(8) when you complete this process and execute │
│ /sbin/lilo after this. │
│ │
│ LILO won't work if you don't do this. │
│ │
│ <Ok> │
│ │
└───────────────────────────────────────────────────────────────────────────┘
ubuntu@ubuntu:~$ sudo lilo -M /dev/sda mbr
Backup copy of /dev/sda in /boot/boot.0800
The Master Boot Record of /dev/sda has been updated.
ubuntu@ubuntu:~$ sudo -s -H
root@ubuntu:~# cd /boot/
root@ubuntu:/boot/# sudo mount /dev/sda7 /mnt
##/dev/sda7为ubuntu系统所在分区
root@ubuntu:/boot/# sudo grub-install --boot-directory=/mnt /dev/sda
root@ubuntu:/boot/# reboot
重启之后发现ubuntu进入grub>引导了。
4. 设置grub。
grub>set root=(hd0,7)
grub>set prefix=(hd0,7)/boot/grub
## 此目录主体tab键提示查找
grub>insmod (hd0,8)/boot/grub/normal.mod
grub>normal
## 执行完毕直接从硬盘进入ubuntu系统
## 进入ubuntu后执行update-grub ,所有工作完成
## 重启ubuntu系统后,发现还是要一直设置grub引导。
## 执行boot-repair,这下好了
root@ubuntu:/boot/# update-grub
root@ubuntu:/boot/#sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
root@ubuntu:/boot/#sudo apt-get install -y boot-repair && boot-repair
## 此处boot-repair有可能安装不成功,重新修改镜像源就可
##Ubuntu Software Center 中修改即可
等待一会,就会出现Boot Repair的软件界面了,点击上面的“recommended repair”按钮,等待一会儿,就会跳出修复成功。
至此ubuntu可以正常引导了。
5. 修复win7引导
通过系统光盘使用winpe进入系统,使用u盘里下载好的BCDautofix软件,执行以下。
回到ubuntu在执行一下
root@ubuntu:/boot/# update-grub
至此win7 + ubuntu都能够正常的使用,正常的引导了。
参考链接:
##修复boot引导
http://www.cnblogs.com/khler/archive/2011/01/31/1948485.html
## grub引导设置
http://www.laifuying.com/archives/436
##u盘引导制作
http://os.51cto.com/art/200911/163420_all.htm