grub overwrites my menu.lst

Bug #87183 reported by anonym
2
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Invalid
Undecided
Brian Murray

Bug Description

When I install a new kernel image, it always overwrites the grub menu.lst and puts incorrect information. For example it puts

hd(0,0) when hd(0,2) is correct.

hda1 when sda3 is correct.

It completely erases my windows partition from menu.lst.

it should automatically fill in the correct information, without user input.

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for your bug report. Could you please add your good menu.lst as an attachment to your bug report? Thanks in advance.

Revision history for this message
anonym (launch-mailinator) wrote :

ok, here is the menu.lst. it's correct.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

as you can read from the menu.lst:

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

so don't do that. Put your windows entry at the end, and change the groot to reflect your ubuntu root-device.

Changed in grub:
status: Needs Info → Rejected
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

hm, I meant that don't edit anything between those markers. Those changes will be overridden.

Revision history for this message
anonym (launch-mailinator) wrote :

Then where do I put the windows partition?

Also, it automatically replaces hd(0,2) with the incorrect hd(0,0).

Also, it automatically replaces sda3 with the incorrect hda1.

Also I filed this because I think this should be automatic, I don't think users should have to know what hd0,0 means or what sda/hda are.

Revision history for this message
anonym (launch-mailinator) wrote :

Ohh sorry, I see that you said to put the windows entry at the end.

Doing that makes the ubuntu entry the default. I want the windows entry to be the default.

Revision history for this message
Brian Murray (brian-murray) wrote :

In your menu.lst file towards the middle you will see this stanza:

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

This part is read, with groot=(hd0,0) being the default every time you run update-grub as Timo mentioned. You will want to add 'groot=(hd0,2)' after the '# groot' part. You could also do something similar for what you want your default OS to be.

Revision history for this message
anonym (launch-mailinator) wrote :

Ok, I will try that for the hd0,2 problem, but what about it changing sda3 to hda1?

also, what do you mean by do something similar to set the default OS? It either has to be the first entry (the way I want it) or you have to select a number in the option. If you select a number then once a new kernel is installed the numbers change, because 2 new entries are added. So if I move windows to the bottom and select "3" as the default OS, once a new kernel is installed 3 would no longer point to the windows entry. As you can see, this is no good.

Revision history for this message
Brian Murray (brian-murray) wrote :

Again looking through your grub.con file you can see:

# kopt_2_6=root=/dev/hda1 ro

This is where hda1 is coming from. You want to change hda1 to sda3 here.

You could change '# howmany=all which' "controls how many kernels should be put into the menu.lst" to fix the number of the default OS. Or you could follow these instructions in the menu.lst file:

"# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'."

So you would change the number of your default OS to saved and add 'savedefault' to your Windows operating system boot option.

Revision history for this message
anonym (launch-mailinator) wrote :

Ok, I fixed the problem, but I really wanted to report the bug. This should be automatically detected. Users shouldn't have to know what hd(0,2) is or what sda3 means.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.