首页 > 编程知识 正文

笔记本安装Ubuntu双系统,ubuntu双系统启动引导设置

时间:2023-05-05 07:57:08 阅读:171635 作者:3804

一、

我的电脑本来是先安装Windows XP的,但由于工作需要,又安装了Linux_Ubuntu 9.04。 虽然设置了计时器启动,但是总是缺省启动到Ubuntu环境。

执行以下操作将Windows XP更改为缺省引导系统:

启动ubuntu后,输入sudo gedit /boot/grub/menu.lst

输入正确的密码,打开menu.lst。

从第一行往下看,找到第一行开头没有#的行

默认0

继续往下看,找到所有以title开头的行。 请不要在意以#开头的东西。

在我的文件中,有7行以title开头的合计(开头没有# ),顺序如下。

title Ubuntu 8.04.1,kernel 2.6.24-21-generic

title Ubuntu 8.04.1,kernel2.6. 24-21-generic (recovery mode ) ) ) ) ) ) ) ) ) ) ) ) ) 65 )

title Ubuntu 8.04.1,kernel 2.6.24-16-generic

title Ubuntu 8.04.1,kernel2.6. 24-16-generic (recovery mode ) ) ) ) ) ) ) ) ) ) ) ) 65 )

title Ubuntu 8.04.1,memtest86

titleotheroperatingsystems :

title Windows NT/2000/XP

这些行不是这样连接在一起的,而是分散在文件中。 一起写这七行是为了让我们能看清楚。 实际上,除了每行前面的title,这7行都是我开机时出现的启动菜单项,系统启动时读的就是这个文件。

默认0

表示默认情况下,上述菜单的第1行(0)的系统正在启动。

因为我看到windows在第7(6)行,所以如果将default的值更改为6,保存文件并重新启动系统,则缺省情况下启动的系统将更改为windows。

二、在Ubuntu 10.04中,没有menu.lst文件,文件名已经是grub.cfg。

改为:

1、将原始文件备份到grub.cfg.bak

代码: sudo CP/boot/grub/grub.CFG/boot/grub/grub.CFG.bak

2、修改启动顺序

代码: sudo gedit/boot/grub/grub.CFG

在打开顶级文件时找到set default='0',可以看到缺省值是第一个项目(从0开始计数)。

然后,找到以menuentry开头的所有行。 以下是我电脑上这个文件的内容。 共有7行,最后一行是Windows XP项目。 以我的文件内容为例,我可以仅通过set default='6(注意:从0开始计算)将Windows XP更改为缺省引导系统。

menuentry 'Ubuntu,Linux 2.6.32-22-generic '

menuentry 'Ubuntu,Linux 2.6.32-22-generic (恢复模式) ) ) ) ) ) ) ) )恢复模式) ) ) ) )恢复模式) ) )

menuentry 'Ubuntu,Linux 2.6.32-21-generic '

menuentry 'Ubuntu,Linux 2.6.32-21-generic (恢复模式) ) ) ) ) ) ) ) )恢复模式) ) ) ) )恢复模式) ) )

menu entry '存储器测试(memtest86 )。

menuentry'memorytest(memtest86,串行控制台115200 ) )。

menu entry ' microsoftwindowsxpprofessional (on/dev/sda1) )。

三.在系统"/boot/grub/"中完全没有" menu.lst "这样的文件的情况下,具体的步骤如下。

以root身份登录Ubuntu

默认情况下,通过选择“系统-系统管理-登录”窗口-“安全”-“允许本地系统管理员登录”,以静止方式登录本地root。 sudo passwd滑架返回; 输入你的密码; 设置超级用户密码; 重复; 可以登录根。

2./boot/grub/目录中没有名为menu.lst的文件。 您自己创建一个新的代码,将以下代码复制到新创建的名为menu.lst的文件中,然后将default的值更改为4并将其保存。

开始:

#menu.lst-see:grub(8)、info grub和update-grub(8) (8) )。

#gruB-install(8)、grub-floppy(8)8)、

#grub-md5-crypt,/usr/share/doc/grub

#and /usr/share/doc/grub-doc/

## default num

# setthedefaultentrytotheentrynumbernum.numberingstartsfrom 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.

default0

## timeout sec

# Set a timeout, in SEC seconds, before automatically booting the default entry

# (normally the first entry defined).

timeout10

## 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

#

# titleWindows 95/98/NT/2000

# root(hd0,0)

# makeactive

# chainloader+1

#

# titleLinux

# 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=04d0edaf-6a91-46c5-8bec-35a97eeaa27f ro

## default grub root device

## e.g. groot=(hd0,0)

# groot=04d0edaf-6a91-46c5-8bec-35a97eeaa27f

## 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

## 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

## specify if running in Xen domU or have grub detect automatically

## update-grub will ignore non-xen kernels when running in domU and vice versa

## e.g. indomU=detect

##indomU=true

##indomU=false

# indomU=detect

## 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 ##

titleUbuntu 9.04, kernel 2.6.28-11-generic

uuid04d0edaf-6a91-46c5-8bec-35a97eeaa27f

kernel/boot/vmlinuz-2.6.28-11-generic root=UUID=04d0edaf-6a91-46c5-8bec-35a97eeaa27f ro quiet splash

initrd/boot/initrd.img-2.6.28-11-generic

quiet

titleUbuntu 9.04, kernel 2.6.28-11-generic (recovery mode)

uuid04d0edaf-6a91-46c5-8bec-35a97eeaa27f

kernel/boot/vmlinuz-2.6.28-11-generic root=UUID=04d0edaf-6a91-46c5-8bec-35a97eeaa27f ro single

initrd/boot/initrd.img-2.6.28-11-generic

titleUbuntu 9.04, memtest86+

uuid04d0edaf-6a91-46c5-8bec-35a97eeaa27f

kernel/boot/memtest86+.bin

quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian

# ones.

titleOther operating systems:

root

# This entry automatically added by the Debian installer for a non-linux OS

# on /dev/sda1

titleMicrosoft Windows XP Professional

rootnoverify(hd0,0)

savedefault

makeactive

chainloader+1

结束。

问题得到解决了吧!呵呵!

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。