 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

8th November 2011, 09:29 PM
|
|
Registered User
|
|
Join Date: Jul 2010
Posts: 43

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

8th November 2011, 11:48 PM
|
 |
Un-Retired Administrator
|
|
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,974

|
|
|
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 © ®
Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
|

9th November 2011, 12:02 AM
|
|
Registered User
|
|
Join Date: Jul 2010
Posts: 43

|
|
|
Re: Grub2 Issues on Fedora 16
thank you. I found that about 5 minutes ago. Evidently grub2 on Fedora is different from Ubuntu.....
|

9th November 2011, 12:13 AM
|
 |
Un-Retired Administrator
|
|
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,974

|
|
|
Re: Grub2 Issues on Fedora 16
Yep. It's not the same. Close, but ...
__________________
Glenn
The Bassinator © ®
Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
|

9th November 2011, 02:58 AM
|
|
Registered User
|
|
Join Date: Jul 2010
Posts: 43

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

13th November 2011, 01:53 AM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 17

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

13th November 2011, 02:01 AM
|
|
Registered User
|
|
Join Date: Jan 2011
Location: Louisburg NC
Posts: 126

|
|
|
Re: Grub2 Issues on Fedora 16
Personally I find it easier just to edit the /boot/grub2/grub.cfg file manually.
|

13th November 2011, 02:07 AM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 17

|
|
|
Re: Grub2 Issues on Fedora 16
You are brave. It is not recommended to edit that file from what I have read.
|

13th November 2011, 02:18 AM
|
|
Registered User
|
|
Join Date: Jan 2011
Location: Louisburg NC
Posts: 126

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

13th November 2011, 05:04 AM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,620

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

13th November 2011, 05:29 AM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 17

|
|
|
Re: Grub2 Issues on Fedora 16
Quote:
Originally Posted by DBelton
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?
|

21st November 2011, 08:15 PM
|
|
Registered User
|
|
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 41
Posts: 254

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

21st November 2011, 09:24 PM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,620

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

21st November 2011, 09:47 PM
|
|
Registered User
|
|
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 41
Posts: 254

|
|
|
Re: Grub2 Issues on Fedora 16
I don't have the directory grub.d? Can I make it?
|

21st November 2011, 09:52 PM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,620

|
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 04:54 (Tuesday, 18-06-2013)
|
|
 |
 |
 |
 |
|
|