Fedora Linux Support Community & Resources Center
  #1  
Old 8th November 2011, 09:29 PM
crokett Offline
Registered User
 
Join Date: Jul 2010
Location: Mebane NC
Posts: 177
linuxfirefox
Grub2 Issues on Fedora 16

My laptop is partitioned with a 1 GB /boot partition, then the rest of the disk is an encrypted volume. The encrypted volume is carved into 4 logical volumes. 2 are for the OS, 1 is for data and 1 is for swap. I have my daily working F15 install on lv_fedora. I installed F16 on another lv named lv_fedoranew. I previously had F14 installed in lv_fedoranew. I installed F16 this morning but now when I boot the laptop grub2 shows me my F16 and F15 installs, but when I select the F15 install it boots to F16 with the 2.40.xx kernel from F15. If take the option to edit boot settings, the entry points to the wrong logical volume. Actually all the entries point to lv_fedoranew. I can boot to F15 by manually editing the boot options to point to the correct lv, but how do I fix this to boot to the correct LV? I tried adding a boot entry to custom_40 in /etc/grub.d but couldn't find the update-grub command to update grub.
Reply With Quote
  #2  
Old 8th November 2011, 11:48 PM
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Age: 57
Posts: 14,768
linuxfirefox
Re: Grub2 Issues on Fedora 16

grub2-mkconfig -o /boot/grub2/grub.cfg

Note the spaces between mkconfig -o and -o /boot
__________________
Glenn
The Bassinator © ®

[SIGPIC][/SIGPIC]
Laptop: Just a couple of old single core units
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / Kingston HyperX 3K SSD 240GB SATA 3.0 / 1TB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #3  
Old 9th November 2011, 12:02 AM
crokett Offline
Registered User
 
Join Date: Jul 2010
Location: Mebane NC
Posts: 177
linuxfirefox
Re: Grub2 Issues on Fedora 16

thank you. I found that about 5 minutes ago. Evidently grub2 on Fedora is different from Ubuntu.....
Reply With Quote
  #4  
Old 9th November 2011, 12:13 AM
glennzo Online
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Age: 57
Posts: 14,768
linuxchrome
Re: Grub2 Issues on Fedora 16

Yep. It's not the same. Close, but ...
__________________
Glenn
The Bassinator © ®

[SIGPIC][/SIGPIC]
Laptop: Just a couple of old single core units
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / Kingston HyperX 3K SSD 240GB SATA 3.0 / 1TB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #5  
Old 9th November 2011, 02:58 AM
crokett Offline
Registered User
 
Join Date: Jul 2010
Location: Mebane NC
Posts: 177
linuxfirefox
Re: Grub2 Issues on Fedora 16

Ok, so the good news is that worked. The bad news is now the menu is a mess. I have several duplicate entries. How can I clean them up? Actually what I really would like is just to fall back to grub and a simple menu.lst file I can edit directly. I'm sure grub2 is better, but it is a PITA on Ubuntu and it is a PITA now.
Reply With Quote
  #6  
Old 13th November 2011, 01:53 AM
mrjoeyman Offline
Registered User
 
Join Date: Oct 2011
Posts: 17
windows_xp_2003chrome
Re: Grub2 Issues on Fedora 16

I got this info from here: http://www.dedoimedo.com/computers/grub-2.html

Quote:
You can add/remove entries by simply chmod-ing the scripts; no need to delete them. GRUB 2 can be reinstalled anytime you want, even while booted in the OS.
Like this:

If you do not want to have the memtest entries included, simply chmod -x the 20_memtest script. It will no longer be executable and won't be read into the grub.cfg file the next time you update GRUB.
Quote:
su - chmod -x 20_memtest86+
I think you can clean up the duplicate entries like this.
Reply With Quote
  #7  
Old 13th November 2011, 02:01 AM
drnetsys Offline
Registered User
 
Join Date: Jan 2011
Location: Louisburg NC
Posts: 127
linuxfirefox
Re: Grub2 Issues on Fedora 16

Personally I find it easier just to edit the /boot/grub2/grub.cfg file manually.
Reply With Quote
  #8  
Old 13th November 2011, 02:07 AM
mrjoeyman Offline
Registered User
 
Join Date: Oct 2011
Posts: 17
windows_xp_2003chrome
Re: Grub2 Issues on Fedora 16

You are brave. It is not recommended to edit that file from what I have read.
Reply With Quote
  #9  
Old 13th November 2011, 02:18 AM
drnetsys Offline
Registered User
 
Join Date: Jan 2011
Location: Louisburg NC
Posts: 127
linuxfirefox
Re: Grub2 Issues on Fedora 16

It was not recommended on grub as well but that was the only way to add entries. Im just so use to it no problems so far. It is the only way to customize the labels as well. I just make sure that any system file I edit I make a copy first.
Reply With Quote
  #10  
Old 13th November 2011, 05:04 AM
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 7,320
linuxfirefox
Re: Grub2 Issues on Fedora 16

really, the only reason that it's not recommended to manually edit your /boot/grub2/grub.cfg file is because the manual changes can and will be wiped out if you run grub2-mkconfig.

Nothing wrong with manually editing your grub.cfg file, just as long as you realize it will be overwritten and you will lose the manual edits if you run grub2-mkconfig at some point in the future.

kernel updates via yum don't run grub2-mkconfig (it uses grubby) so manual edits will not be overwritten then, so your edits will be fairly safe unless you manually run grub2-mkconfig.
Reply With Quote
  #11  
Old 13th November 2011, 05:29 AM
mrjoeyman Offline
Registered User
 
Join Date: Oct 2011
Posts: 17
windows_xp_2003chrome
Re: Grub2 Issues on Fedora 16

Quote:
Originally Posted by DBelton View Post
really, the only reason that it's not recommended to manually edit your /boot/grub2/grub.cfg file is because the manual changes can and will be wiped out if you run grub2-mkconfig.

Nothing wrong with manually editing your grub.cfg file, just as long as you realize it will be overwritten and you will lose the manual edits if you run grub2-mkconfig at some point in the future.

kernel updates via yum don't run grub2-mkconfig (it uses grubby) so manual edits will not be overwritten then, so your edits will be fairly safe unless you manually run grub2-mkconfig.
Sweet. Question: I normally install grub to a /boot partition that I create for the install, and manage booting from easybsd in my Windows install. If I install Fedora 16, will I be able to install grub2 to the /boot partition that I create for that install too?
Reply With Quote
  #12  
Old 21st November 2011, 08:15 PM
synic Offline
Registered User
 
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 43
Posts: 266
linuxopera
Re: Grub2 Install Memtest into Grub2 Menu Option

Hi,

I actually want to install Memtest into the Grub Menu.

I had started mucking around with the menu manually then found this posting.

I have memtest86+-4.20 in the /boot directory.

How can I ad it as an option to the grub menu so that I can run it as a boot option?

I'm a little stuck. All the Ubuntu blogs appear to be a different from Fedora.
__________________
Discourse and Diatribe
Reply With Quote
  #13  
Old 21st November 2011, 09:24 PM
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 7,320
linuxfirefox
Re: Grub2 Issues on Fedora 16

did you install memtest from the fedora repo?

And did you run memtest-setup as root user?

That should have configured things for you (if memtest has been updated to update grub2 versus legacy grub)

Edit:

I have found what you need as memtest-setup doesn't appear to run correctly with grub2 currently. (should be fixed soon, though)

Create a file in /etc/grub.d named 23_memtest with these contents:

Code:
#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2011  Michal Ambroz <rebus@seznam.cz>
#
# 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.
#
# 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 the script.  If not, see <http://www.gnu.org/licenses/>.

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

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=${prefix}/share/locale

CLASS=""

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=Memtest
else
  OS="${GRUB_DISTRIBUTOR} Memtest"
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/"`
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
    || uses_abstraction "${GRUB_DEVICE}" lvm; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
  rootsubvol="`make_system_path_relative_to_its_root /`"
  rootsubvol="${rootsubvol#/}"
  if [ "x${rootsubvol}" != x ]; then
    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
  fi
fi

memtest_entry ()
{
  os="$1"
  version="$2"
  recovery="$3"
  args="$4"
  title="$(gettext_quoted "%s %s")"
  printf "menuentry '${title}' {\n" "${os}" "${version}"


  if [ x$dirname = x/ ]; then
    if [ -z "${prepare_root_cache}" ]; then
      prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")"
    fi
    printf '%s\n' "${prepare_root_cache}"
  else
    if [ -z "${prepare_boot_cache}" ]; then
      prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
    fi
    printf '%s\n' "${prepare_boot_cache}"
  fi
  message="$(gettext_printf "Loading %s %s ..." ${os} ${version})"
  cat << EOF
	echo	'$message'
	linux16	${rel_dirname}/${basename}
}
EOF
}

case x`uname -m` in
    xi?86 | xx86_64)
	list=`for i in /boot/memtest* ; do
                  if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
              done` ;;
    *) 
	list=`for i in /boot/memtest* ; do
                  if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
	     done` ;;
esac

prepare_boot_cache=
prepare_root_cache=

while [ "x$list" != "x" ] ; do
  linux=`version_find_latest $list`
  echo "Found memtest 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}"


  memtest_entry "${OS}" "${version}" false \
      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"

  list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done
Then run:
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
(all these need to be done as root user)

script and everything was from the bugzilla report on this issue:

https://bugzilla.redhat.com/show_bug.cgi?id=729197

Last edited by DBelton; 21st November 2011 at 09:30 PM.
Reply With Quote
  #14  
Old 21st November 2011, 09:47 PM
synic Offline
Registered User
 
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 43
Posts: 266
linuxopera
Re: Grub2 Issues on Fedora 16

I don't have the directory grub.d? Can I make it?
__________________
Discourse and Diatribe
Reply With Quote
  #15  
Old 21st November 2011, 09:52 PM
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 7,320
linuxfirefox
Re: Grub2 Issues on Fedora 16

What version of Fedora are you running?

If you have F16 and are running grub2, then you should have the /etc/grub.d directory

If you are running F15 and older, you probably are still using legacy grub, and in that case, all you need to do it to run memtest-setup as root and it will update your grub config for you.
Reply With Quote
Reply

Tags
fedora, grub2, issues

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How-To Using Grub2 in Fedora VastOne Guides & Solutions (No Questions) 41 19th February 2012 12:28 PM
New Fedora 16 and grub2 snoze Installation, Upgrades and Live Media 2 7th November 2011 10:57 PM
how to install grub2+fedora instead of mac os? fmmail Mac Chat 4 29th April 2011 12:58 AM
[SOLVED] Issues with grub2 JamesNZ Using Fedora 2 13th November 2010 03:29 AM
Grub2 on Fedora Core 4 Computer Guru Using Fedora 8 8th November 2005 11:58 AM


Current GMT-time: 09:32 (Friday, 24-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Nangen Travel Photos - Krasnoznamensk Travel Photos on Instagram - Gharo Photos on Instagram