---
title: "ubuntu9.10(karmic)修复Windows系统引导"
author: "firecool"
date: "2009-10-01T14:50:22Z"
tags: []
slug: "ubuntu9-10-karmic-windows"
draft: false
lastmod: "2009-12-01T10:21:15Z"
id: 481168
url: "https://firecool.iteye.com/blog/481168"
---

ubuntu9.10使用了grub2(不确定是不是2)，与以往不同新版本的[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") 的引导配置文件不再是menu.lst而是/boot/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") /[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .cfg ，这个文件默认是只读的，因此在修改之前需要先将其改为可写。

> root@ptubuntu:/home/ptubuntu# chmod +w /boot/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") /[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .cfg

然后就可以修改了。给其中加上如下内容即可

> root@ptubuntu:/home/ptubuntu# vi /boot/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") /[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .cfg

添加后内容如下：

> ### BEGIN /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/00\_header ###  
> set default=0  
> set timeout=5  
> set root=(hd0,7)  
> search –no-floppy –fs-uuid –set 5deb40f9-217d-408d-bc7c-be463cbfea7b  
> if loadfont /usr/share/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") /ascii.pf2 ; then  
> set gfxmode=640×480  
> insmod gfxterm  
> insmod vbe  
> if terminal\_output gfxterm ; then true ; else  
> # For backward compatibility with versions of terminal.mod that don’t  
> # understand terminal\_output  
> terminal gfxterm  
> fi  
> fi  
> ### END /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/00\_header ###
> 
> ### BEGIN /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/05\_debian\_theme ###  
> set menu\_color\_normal=cyan/blue  
> set menu\_color\_highlight=white/blue  
> ### END /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/05\_debian\_theme ###
> 
> menuentry “Microsoft Windows XP Professional” {  
> set root=(hd0,1)  
> search –no-floppy –fs-uuid –set 4a807ca0807c93e3  
> drivemap -s (hd0) $root  
> chainloader +1  
> }
> 
> 上面这段黄色就是原来自带的。现在要改为下面红色。
> 
> menuentry “Microsoft Windows XP Professional” {  
> set root=(hd0,1)  
> chainloader +1  
> }  
> ### BEGIN /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/10\_linux ###  
> menuentry “[Ubuntu](http://www.ptubuntu.com/tag/ubuntu "标签 Ubuntu 下的日志") , Linux 2.6.31-3-generic” {set root=(hd0,7)  
> search –no-floppy –fs-uuid –set 5deb40f9-217d-408d-bc7c-be463cbfea7b  
> linux   /boot/vmlinuz-2.6.31-3-generic root=UUID=5deb40f9-217d-408d-bc7c-be463cbfea7b ro   quiet splash  
> initrd  /boot/initrd.img-2.6.31-3-generic  
> }  
> menuentry “[Ubuntu](http://www.ptubuntu.com/tag/ubuntu "标签 Ubuntu 下的日志") , Linux 2.6.31-3-generic (recovery mode)” {  
> set root=(hd0,7)  
> search –no-floppy –fs-uuid –set 5deb40f9-217d-408d-bc7c-be463cbfea7b  
> linux   /boot/vmlinuz-2.6.31-3-generic root=UUID=5deb40f9-217d-408d-bc7c-be463cbfea7b ro single  
> initrd  /boot/initrd.img-2.6.31-3-generic  
> }  
> ### END /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/10\_linux ###
> 
> ### BEGIN /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/20\_memtest86+ ###  
> menuentry “Memory test (memtest86+)” {  
> linux   /boot/memtest86+.bin  
> }  
> menuentry “Memory test (memtest86+, serial console 115200)” {  
> linux   /boot/memtest86+.bin console=ttyS0,115200n8  
> }  
> ### END /etc/[grub](http://www.ptubuntu.com/tag/grub "标签 grub 下的日志") .d/20\_memtest86+ ###