Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101938603
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: LINUX

2008-04-08 13:11:10

作者: petcon  出自:

其实我想每一个装ubuntu的人一开始可能并不想抛弃xp,更多是想双操引导,双系统启动。我是物理隔离下安装的xp和ubuntu,所以当我把两个硬盘都插上电脑的时候,双系统启动肯定是要设置了才可以。前两篇介绍的如何安装和加快更新速度。这篇其实更是急迫一些。下面详细介绍如何双系统启动。

我的xp是安装在sata的250GB硬盘上,ubuntu是安装在ide的80GB的硬盘上。两个系统都是在物理隔离(拔了另一个电源线)的情况下安装的。当然下面的方法对于在一个硬盘安装的双系统,也是可以用的。

首先,到ubuntu的/boot/grub复制menu.lst文件到u盘(如果你的u盘中毒了,可以看我的另一篇),如果你没有u盘可以上传到网络硬盘或者你的邮箱。

然后去下载一个名叫glrldr的文件,如果你找不到,或者觉得网络上的不可靠,可以找我要。我的这个至少我用的很好,可以引导双操启动。

然后进windows xp,把刚刚说的两个文件都拷贝到c盘的根目录下。然后显示所有隐藏文件和系统文件。找到一个叫boot.ini的文件,在这个文件上点右键,将只读取消,然后打开这个文件,在最后换行加入一句话C:\grldr=ubuntu 7.10

下面是我的boot.ini的内容(两个-------之间的内容,不包括------------)
----------------------------------
[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
C:\grldr=ubuntu 7.10
----------------------------

这样基本的事情做完了。但是有一个地方要改改才能顺利启动ubuntu。下面是我的menu.lst的原始文件的内容。

-------------------------------

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=b6038bb7-6d4a-4f78-a071-adbb6459113a ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash locale=zh_CN

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=b6038bb7-6d4a-4f78-a071-adbb6459113a ro quiet splash locale=zh_CN
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=b6038bb7-6d4a-4f78-a071-adbb6459113a ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

-----------------------------
我没有删除注释部分。下面是我改后的(只贴了部分),已经用红色黑体并大了一号。原来是0的地方,我改成了1。下面讲一下为什么。这个hd(数字一,数字二),数字一是指第几块硬盘,数字二是指第几个分区。因为我的ubuntu安装在第二块硬盘第一个分区所以是1,0(这个数字是从0开始的),所以大家可以依葫芦画瓢。只有一块硬盘的第一个数字肯定是0,后面的分区数字大家可以试试,很容易就可以启动了。

itle Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=b6038bb7-6d4a-4f78-a071-adbb6459113a ro quiet splash locale=zh_CN
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=b6038bb7-6d4a-4f78-a071-adbb6459113a ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
quiet

通过上面的工作,在开机之后会在进入xp的有两个选项(大概就是下面的样子),选下一个进可以进ubuntu了。那个ubuntu 7.10是自己写的,可以在boot.ini里随便改成什么。

Microsoft Windows XP Professional
ubuntu 7.10

下面再总结一下,首先要有两个文件glrldr(可以找我要)和menu.lst(自己的ubuntu文件,要改动内容)都放在c盘根目录。改动boot.ini,就可以启动了。其实非常容易就可以做到双系统引导了。
阅读(421) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~