Grub vs updates

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Grub vs updates

Postby kenberto on Thu Mar 12, 2009 3:28 am

Twice now when I did a big upgrade with Package Manager, I then lost the ability to boot into my windows partition. I.e. I re-boot after update, and what used to be the first default option, win xp, is just plain gone. Only various mint options are there now. Now I know some would argue this is in fact a feature, but I do still need to boot to windows on this computer, and as this has happened twice now I'm getting pretty frustrated with having to manually muck around with these things. A quick googling doesn't indicate this happens to many people....do I have something set-up wrong? Is there something I can fix to prevent this from happening?
kenberto
Level 1
Level 1
 
Posts: 2
Joined: Thu Mar 12, 2009 3:19 am

Linux Mint is funded by ads and donations.
 

Re: Grub vs updates

Postby Fred on Thu Mar 12, 2009 3:49 am

kenberto wrote:
I'm getting pretty frustrated with having to manually muck around with these things.

It sounds as if you are not setting the options in the menu.lst necessary to make your corrections to the menu.lst permanent. Sometimes during an update your grub install is reconstituted for one reason or another related to the specific files that are changed during the update. A kernel update is an example of this.

When you changed your menu.lst did you also set your

# kopt=root=
# groot=
# defoptions=
# updatedefaultentry=
# savedefault=
# howmany=

lines to reflect any changes you made to the menu.lst? If not then this is most likely the problem.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Grub vs updates

Postby merlwiz79 on Thu Mar 12, 2009 4:10 am

Linux Mint uses grub-gfxboot.
I am the one who maintains this package.
I have updated it a few times and it shouldn't change anything below:
Code: Select all
### END DEBIAN AUTOMAGIC KERNELS LIST

It should only add or remove kernels that have been installed or uninstalled.
I have Windows 7 beta and XP Pro installed and the entry to boot those never disappear.
User avatar
merlwiz79
Level 11
Level 11
 
Posts: 3637
Joined: Wed Apr 04, 2007 1:50 pm
Location: Here again :)

Re: Grub vs updates

Postby Fred on Thu Mar 12, 2009 4:18 am

merlwiz79,

Yes, but he could have changed his boot preference incorrectly by the placement of the boot stanza, as an example.

Actually there are a number of things that can be done that would wipe out the Windows boot with a update-grub command.

You are making the assumption that any changes he has made were done properly, which is obviously not the case since update-grub seems to be wiping out the apparent ability to boot Windows from his visible menu.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Grub vs updates

Postby kenberto on Fri Mar 13, 2009 3:50 am

Thanks both for the replies.

Fred: I don't think I changed those. The first menu.lst was created for me when I installed Mint. The second time was several months back when I updated and couldn't get to windows, and I think I just tried to figure out whatever it would take take to get win back. I did quickly skim through the comments in menu.lst, and none of the other options popped out as being obviously associated with my problem, but I could be wrong. My current menu.lst is:


Code: Select all
# 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.
default      0

gfxmenu=/etc/grub/message.mint

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

# 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=/dev/sda2 ro

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

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

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery mode) 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

## ## End Default Options ##

title         Win XP
root       (hd0,0)
savedefault
makeactive
chainloader   +1


title      Linux Mint, kernel 2.6.22-16-generic
root      (hd0,1)
kernel      /boot/vmlinuz-2.6.22-16-generic root=/dev/sda2 ro quiet splash
initrd      /boot/initrd.img-2.6.22-16-generic
boot

title      Linux Mint, kernel 2.6.22-16-generic (recovery mode)
root      (hd0,1)
kernel      /boot/vmlinuz-2.6.22-16-generic root=/dev/sda2 ro single
initrd      /boot/initrd.img-2.6.22-16-generic
boot


title      Linux Mint, kernel memtest86+
root      (hd0,1)
kernel      /boot/memtest86+.bin
boot

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



Also, yes, don't assume I've made any changes properly. However I didn't start messing with menu.lst until the first time this happened. My current solution for the future is to copy menu.lst to menu.lst.winsafe so I can merge back if it re-appears, but I am curious what I could have done to make this come about, and if there is a more proper solution.

merlwiz79: Currently all of my boot options lie between
## ## End Default Options ##
and
### END DEBIAN AUTOMAGIC KERNELS LIST

If I move the Win XP to after the ### END DEBIAN... will that solve my problem?

Thanks again for the help!
kenberto
Level 1
Level 1
 
Posts: 2
Joined: Thu Mar 12, 2009 3:19 am

Re: Grub vs updates

Postby Fred on Fri Mar 13, 2009 4:32 am

kenberto,

It appears that you put your Windows boot stanza in with the automagic boot stanzas. Probably to get it to boot by default. Up toward the top of that file is an entry you can use to select the default boot. You want it set as shown below to get Windows to boot by default. The numbering starts at 0 and you count the number of title lines that aren't commented.

## 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.
default 4

The boot stanzas at the bottom should look like I have shown below.

## ## End Default Options ##

title Linux Mint, kernel 2.6.22-16-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.22-16-generic root=/dev/sda2 ro quiet splash
initrd /boot/initrd.img-2.6.22-16-generic
boot

title Linux Mint, kernel 2.6.22-16-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.22-16-generic root=/dev/sda2 ro single
initrd /boot/initrd.img-2.6.22-16-generic
boot

title Linux Mint, kernel memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

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

title Other operating systems:
#

title Win XP
root (hd0,0)
savedefault
makeactive
chainloader +1

As merlwiz79 pointed out, the stanzas not within the automagic section are not tampered with. Any boot stanzas you want to manually add and be persistent must be before the line:

### BEGIN AUTOMAGIC KERNELS LIST

or after the line:

### END DEBIAN AUTOMAGIC KERNELS LIST

You select the stanza you want to boot by default with the setting I showed you above. By counting the number of "title" lines from the top to the stanza you want to boot, less one. If you want your Windows stanza to appear at the top of your menu you would put that stanza above the "begin" line and leave the default set to 0 to boot it by default.

I hope this helps you. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA


Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Hecubus and 27 guests