changing boot order in dual xp/ubuntu 8.04

Asked by JAMES on 2008-08-29

I have a standard windows xp/ubuntu setup from ubuntu install disc and would like to change setup order. I know how to access edit for boot.ini and to restore original mbr with fixmbr.
My current boot.ini is
[boot loader]
timeout=15
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=OptIn

I would delete last bit NoExecute. The additional line for ubuntu would need to change partition from 1 to 2. Exactly what text do I insert to replace WINDOWS= IN NEW LINE?

Would I need to change grub loader equivalent to boot.ini in Ubuntu and how do I do this? A look at menu.1st is mainly information text and the first 4 lines contains no reference to windows/ubuntu so is clearly not the file for this bootloader.
Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
Angel Ramirez Isea
Solved:
2008-08-29
Last query:
2008-08-29
Last reply:
2008-08-29

I'm not sure if this is what you need, but I undestand you have GRUB as your boot manager, and the boot.ini information was given to inform what will happen when Windows is selected.

In that case: In your /boot/grub/menu.lst file, look for the lines that contain:

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

(they are near the top)

and change the 0 (or whatever yours has) for the number that corresponds to your desired first option. The numbers are counted starting from 0, not from 1.

If that is not what you want, go further down in the menu.lst and after the line:

## ## End Default Options ##

you will find your operating systems listed in blocks of about 4 or 5 lines. You can move those blocks around, but be careful to copy the WHOLE block. They are separated by blank lines.

JAMES (jim1-exemail) said : #2

I will change last of top lines from
default 0
to
default 1
and let you know later if this is ok.
Thanks
----- Original Message -----
From: "Angel Ramírez Isea" <email address hidden>
To: <email address hidden>
Sent: Saturday, August 30, 2008 6:06 AM
Subject: Re: [Question #43572]: changing boot order in dual xp/ubuntu 8.04

Your question #43572 on Ubuntu changed:
https://answers.launchpad.net/ubuntu/+question/43572

    Status: Open => Needs information

Angel Ramírez Isea requested for more information:
I'm not sure if this is what you need, but I undestand you have GRUB as
your boot manager, and the boot.ini information was given to inform what
will happen when Windows is selected.

In that case: In your /boot/grub/menu.lst file, look for the lines that
contain:

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

(they are near the top)

and change the 0 (or whatever yours has) for the number that corresponds
to your desired first option. The numbers are counted starting from 0,
not from 1.

If that is not what you want, go further down in the menu.lst and after
the line:

## ## End Default Options ##

you will find your operating systems listed in blocks of about 4 or 5
lines. You can move those blocks around, but be careful to copy the
WHOLE block. They are separated by blank lines.

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/ubuntu/+question/43572

You received this question notification because you are a direct
subscriber of the question.

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

No virus found in this incoming message.
Checked by AVG.
Version: 8.0.169 / Virus Database: 270.6.10/1638 - Release Date: 8/27/2008
7:06 PM

JAMES (jim1-exemail) said : #3

My current first lines are
 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/.

So please confirm your suggestions for making windows the default which is currently the 4th item listed at startup screen.

Also if I change boot.ini which may not be required now is ubuntu the correct name to insert infirst entry in text as per my first message.

JAMES (jim1-exemail) said : #4

In your earlier reply you asked if grub was default loader. I assume this is so - how could I check this out?
Thanks.

Ok. For the first part: If Windows is fourth, you'd set default to 3.

For the second part, if you installed Ubuntu in second place, GRUB is probably your boot loader. Otherwise, you would have had to set up the windows boot.ini. Did you do that?

JAMES (jim1-exemail) said : #6

I have not made any changes to setup by ubuntu yet.
I notice in the grub listing I sent you there is no default shown.
Do I simply add this to the top lines and where in this listing do I put it eg as first or last irem.
I also notice there is no timeout entry.
So at present I am just using startup as set by ubuntu installer.
I do not find the grub loader very logical!!

That's weird. Please copy and paste the whole menu.lst contents here. I'll make some changes and paste it back.

JAMES (jim1-exemail) said : #8

Here is copy requested. I have made no changes myself.
#
# 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=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro

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

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

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

## 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 8.04.1, kernel 2.6.24-19-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,4)
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.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1

JAMES (jim1-exemail) said : #9

That last item missed some bits

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

## 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=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro

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

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

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

## 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 8.04.1, kernel 2.6.24-19-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,4)
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.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1

It looks incomplete. I'm posting a hybrid between yours and mine that should work fine. Copy this into your menu.lst (substitute everything originally there). Save and reboot.

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

## 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=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro

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

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

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

## 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 Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,4)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=98d13fe8-fe0b-489b-b26e-9ea46e5899ef ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,4)
kernel /boot/memtest86+.bin
quiet

JAMES (jim1-exemail) said : #11

I deleted contents menu 1 but it refused to allow me to carry out paste command to import your file.
Any way round this please?

That's true! Sorry, I forgot to mention the fact that linux won't let you change the contents of some sensitive files unless you are the SuperUser.

Close any open window of your text editor. Open a terminal and execute this command:

sudo gedit /boot/grub/menu.lst

or

sudo mousepad /boot/grub/menu.lst

The first one is for gnome desktops, the second is for XFCE (Xubuntu).

JAMES (jim1-exemail) said : #13

After a few misses this worked.
Many thanks;
.If you have the time perhaps you could idicate what actual changes you made or refer me to a source of info in case I decide to reverse these changes in future.
I really appreciate the time you took over this.
JAMES WATKINS

JAMES (jim1-exemail) said : #14

Thanks Angel Ramírez Isea, that solved my question.

You are very welcome, James. This is the official source of the grub program:

http://www.gnu.org/software/grub/manual/grub.html

The part that contains the changes I made is:
http://www.gnu.org/software/grub/manual/grub.html#Configuration

It is good that you learn this, because sometimes, when the kernel is updated, the menu.lst file changes automatically and you may lose your changes.

Happy Linuxing! ;)