LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-06-2010, 09:36 AM   #1
adunamia
Member
 
Registered: Aug 2008
Distribution: Ubuntu, Linux Mint, Xubuntu, gOS, Puppy Linux
Posts: 48

Rep: Reputation: 18
Grub2 boot entries don't change


My grub2 boot entries never change. I have run sudo update-grub and it finds all the proper kernels and such and says that it has updated. I check with the menu.lst and grub.cfg and they both look to be correct, however, when I go to boot I am stuck with my old boot entries. Any ideas?
 
Old 02-06-2010, 09:46 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
menu.lst is not used by grub2 which is very different from grub
Here is a good grub2 tutorial.
 
Old 02-06-2010, 10:02 AM   #3
adunamia
Member
 
Registered: Aug 2008
Distribution: Ubuntu, Linux Mint, Xubuntu, gOS, Puppy Linux
Posts: 48

Original Poster
Rep: Reputation: 18
I am aware of that, but it is chainloading from legacy grub which does use the menu.lst. I have read many a tutorial and even changed boot entries, removed them, edited header, etc. in grub2, so it isn't a simple lack of understanding. everything is giving the correct output and looks as it should, but it doesn't update when I actually boot.
 
Old 02-06-2010, 10:12 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
everything is giving the correct output and looks as it should, but it doesn't update when I actually boot.
You are not explaining anything very clearly.

Presumably you have grub installed on your MBR - Am I right?
Where did you install grub2 to?
How many OSs are you trying to boot?
On what partitions are their /boot directories?
Which OS are you running when you update grub?
Which OS are you running when you update grub2?

Edit: This thread may help
/Edit

Last edited by tredegar; 02-06-2010 at 10:15 AM.
 
Old 02-06-2010, 10:23 AM   #5
adunamia
Member
 
Registered: Aug 2008
Distribution: Ubuntu, Linux Mint, Xubuntu, gOS, Puppy Linux
Posts: 48

Original Poster
Rep: Reputation: 18
Right, sorry about the lack of information.

I'm running Ubuntu 9.10
output of sudo update-grub:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.31-19-generic
Found kernel: /boot/vmlinuz-2.6.31-17-generic
Found kernel: /boot/vmlinuz-2.6.31-16-generic
Found kernel: /boot/vmlinuz-2.6.31-14-generic
Found GRUB 2: /boot/grub/core.img
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

I have it installed to the MBR and I have vista installed also (I realize that output is not detecting vista but that is easily remedied).

output of fdisk -l:
/dev/sda1 * 1 24807 199262196 7 HPFS/NTFS
/dev/sda2 24808 30401 44933805 5 Extended
/dev/sda5 24808 30166 43046136 83 Linux
/dev/sda6 30167 30401 1887606 82 Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8827dbfe

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 121601 976757760 7 HPFS/NTFS

the boot directory is located on /dev/sda5 with all the other ubuntu files, I created no separate partitions. /dev/sdb1 is a 1TB backup drive that is used as backup primarily.


hope that helps enough
 
Old 02-06-2010, 10:38 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I have it installed to the MBR
I am assuming "it" refers to grub2, and if that is on the MBR, then grub cannot be, and should reallly be ignored.

If you only have ubuntu9.10, memtest86 and vista then why are you bothering to use grub legacy at all?
Just use grub2, installed to the MBR. If you rename /boot/grub/menu.lst to something else grub2 should just ignore "legacy grub" the next time you do sudo update-grub

And if you are not using ext4, you can still use grub legacy to boot 91.0

How did you get into this mess? I am guessing that you "upgraded" from a previous 'buntu installation, and did not do a "clean install".

Did you see the link I added to post #4?
 
Old 02-06-2010, 10:45 AM   #7
adunamia
Member
 
Registered: Aug 2008
Distribution: Ubuntu, Linux Mint, Xubuntu, gOS, Puppy Linux
Posts: 48

Original Poster
Rep: Reputation: 18
I did look at that and did not find it helpful. This was a clean install and I have not tampered with anything grub on this install (built a separate pc in the mean time). I am using ext4 and I was not aware I was chainloading legacy until I found the menu.lst (which was odd) and noticed it was set to chainload grub2. I've had nightmares with manually reinstalling grub2 mostly with it not finding any boot entries, so I'm trying to avoid that.
 
Old 02-06-2010, 10:59 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
I did a clean install of 9.10 and do not have grub legacy at all, just grub2, which does work.

Take a look at /etc/default/grub and make sure the defaults are sensible for what you want (Eg, I never want a hidden menu).

Check the scripts on /etc/grub.d

Then try renaming /boot/grub/menu.lst to something else, and do sudo update-grub
 
Old 02-06-2010, 11:15 AM   #9
adunamia
Member
 
Registered: Aug 2008
Distribution: Ubuntu, Linux Mint, Xubuntu, gOS, Puppy Linux
Posts: 48

Original Poster
Rep: Reputation: 18
no hidden menu entries (just checked) grub.d 10_linux looks right, but maybe you'll see something I'm missing. I've tried sudo update-grub (it prompts me to make a menu.lst) I've tried passing both no and yes, makes no difference. same goes for sudo update-grub 2

My 10_linux file:

#! /bin/sh -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
. ${libdir}/grub/grub-mkconfig_lib

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${GRUB_DISTRIBUTOR}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
/dev/loop/*|/dev/loop[0-9])
GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
# We can't cope with devices loop-mounted from files here.
case ${GRUB_DEVICE} in
/dev/*) ;;
*) exit 0 ;;
esac
;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
|| [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

# add crashkernel option if we have the required tools
if [ -x "/usr/bin/makedumpfile" ] && [ -x "/sbin/kexec" ]; then
GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M"
fi

linux_entry ()
{
cat << EOF
menuentry "$1" {
recordfail=1
if [ -n \${have_grubenv} ]; then save_env recordfail; fi
EOF
if [ "x$3" = "xquiet" ]; then
cat << EOF
set quiet=1
EOF
fi
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
cat << EOF
linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2
EOF
if test -n "${initrd}" ; then
cat << EOF
initrd ${rel_dirname}/${initrd}
EOF
fi
cat << EOF
}
EOF
}

list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done`

while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
echo "Found linux image: $linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"

initrd=
for i in "initrd.img-${version}" "initrd-${version}.img" \
"initrd-${version}" "initrd.img-${alt_version}" \
"initrd-${alt_version}.img" "initrd-${alt_version}"; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break
fi
done
if test -n "${initrd}" ; then
echo "Found initrd image: ${dirname}/${initrd}" >&2
else
# "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here.
linux_root_device_thisversion=${GRUB_DEVICE}
fi

linux_entry "${OS}, Linux ${version}" \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
quiet
if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS}, Linux ${version} (recovery mode)" \
"single ${GRUB_CMDLINE_LINUX}"
fi

list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done

Last edited by adunamia; 02-06-2010 at 11:21 AM.
 
Old 02-06-2010, 12:57 PM   #10
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Well, the transition from grub to grub2 doesn't seem to have been handled very well by ubuntu.
On 8.04 I have grub and the command update-grub updates grub legacy
On 9.10 I have grub2 and the command update-grub updates grub2
On 9.10 update-grub2 just runs update-grub (which updates grub2 anyway)

On 9.10 grub2 is 2 packages, grub-pc and grub-common
On 8.04 grub is one package called grub

So, on 9.10 I suggest you use your package manager to remove (and purge) the package called grub
Make sure you keep grub-pc and grub-common though

That way you should have got rid of grub legacy (which should not be there in the first place with a clean install) and all the files associated with it.

Then you can get grub2 working without the added complexities of grub legacy getting in the way
 
Old 02-09-2010, 03:35 PM   #11
adunamia
Member
 
Registered: Aug 2008
Distribution: Ubuntu, Linux Mint, Xubuntu, gOS, Puppy Linux
Posts: 48

Original Poster
Rep: Reputation: 18
That did the trick. I had grub-common and grub installed, but not grub-pc. I still don't know how that happened since it was a default installation, but oh well. Thanks!
 
  


Reply

Tags
boot, entries, grub2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone tried grub2 to boot of an iso? niravshah Linux - Newbie 12 08-03-2010 09:53 AM
[SOLVED] How do I boot up In Grub2 If It is using grub legacy now ? obnascar Linux - Software 2 10-22-2009 12:08 PM
Modifying distros iso images to boot with grub2 NightHorse Linux - Distributions 3 10-12-2009 06:46 PM
Grub2 and iso boot ---- Again niravshah Linux - Newbie 6 09-18-2009 03:32 PM
Error 18 when trying to boot with GRUB or GRUB2 DaneM Linux - Software 6 09-20-2005 02:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration