LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   fresh Slackware install: 4 grub menu items? (http://www.linuxquestions.org/questions/slackware-14/fresh-slackware-install-4-grub-menu-items-853792/)

Ubunoob001 01-02-2011 08:12 PM

fresh Slackware install: 4 grub menu items?
 
So I just did a fresh install of Slackware 13.1:

However, I get 4 grub listings for Slackware.

1. leads to kernel panic.
Code:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (8,5) PID: 1, comm: swapper not tainted 2.6.33.4 # call trace: ...
2. leads to kernel panic but with
Code:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (8,5) PID: 1, comm: swapper not tainted 2.6.33.4-smp # call trace: ...
3.... welcome to Linux 2.6.33.4 (tty1)

4. Welcom to Linux 2.6.33.4-smp (tty1)


I have never had any trouble with grub, and consequently never had to edit much in grub. Can anyone suggest A. what is going on, and B. should I edit grub?

edit: So from some reading I have been doing, it seems like maybe these are associated with 2 huge ( regular and smp) and 2 generic kernels (regular and smp). Can anyone confirm this? Many thanks.

I realize this is a bit of a newbie question so feel free to just point me in the right direction. thanks again!

Thanks.

T3slider 01-02-2011 08:29 PM

I believe GRUB just detected all of the kernel images in /boot, and setup listings for each of them. 1. and 2. would be the generic and generic-smp kernels (assuming you're using 32-bit Slackware...), both of which require an initrd. Read /boot/README.initrd and try to switch to the generic-smp kernel (read CHANGES_AND_HINTS.TXT on the install media or on your favourite mirror for information).

colorpurple21859 01-02-2011 08:29 PM

Assuming your using Ubuntu grub what is in your /boot/grub.grub.cfg files. My first guess is that the first two entries are pointing to a slackware generic kernel, and either you haven't created an /boot/intrd.gz in slackware and/or don't have an initrd line in your grub slackware entry.

@T3slider I guess I type to slow you beat me to the punch

andrewthomas 01-02-2011 08:30 PM

You should try to boot to the huge kernel, if you have it, although it doesn't seem that you do. Otherwise you need to generate an initrd from within a chroot with support for your filesystem.

bonixavier 01-02-2011 08:38 PM

It's a problem with that script mess that is grub2. If you insist on using grub, you could install grub legacy that is much more sensible.

Ubunoob001 01-02-2011 08:47 PM

Quote:

Originally Posted by colorpurple21859 (Post 4210914)
Assuming your using Ubuntu grub what is in your /boot/grub.grub.cfg files. My first guess is that the first two entries are pointing to a slackware generic kernel, and either you haven't created an /boot/intrd.gz in slackware and/or don't have an initrd line in your grub slackware entry.[..]

the contents of grub.cfg are below. I assume based on the information contained that indeed since I have not created intrd then the generics are not loading properly. For now, till i get set up (just installed)I will use the "huge".

Quick follow up questions:

1. Just for my basic config/setup prior to learning to switch to generic, should i be using the huge-smp or just huge? (I am on a 64 bit processor, 2 year old Dell Inspiron 1545) However, I am running 32 bit Slackware.

and

2. Why when I installed Slackware (also 13.1) alongside Ubuntu a while back, this issue never cropped up?

thanks everyone for the help.

Code:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
  set saved_entry=${prev_saved_entry}
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-27-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,8)'
        search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
        linux        /boot/vmlinuz-2.6.32-27-generic root=UUID=b2f08ed4-e255-4edd-85fe-de56c2792720 ro  quiet splash
        initrd        /boot/initrd.img-2.6.32-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-27-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,8)'
        search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
        echo        'Loading Linux 2.6.32-27-generic ...'
        linux        /boot/vmlinuz-2.6.32-27-generic root=UUID=b2f08ed4-e255-4edd-85fe-de56c2792720 ro single
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-2.6.32-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,8)'
        search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
        linux        /boot/vmlinuz-2.6.32-24-generic root=UUID=b2f08ed4-e255-4edd-85fe-de56c2792720 ro  quiet splash
        initrd        /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,8)'
        search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
        echo        'Loading Linux 2.6.32-24-generic ...'
        linux        /boot/vmlinuz-2.6.32-24-generic root=UUID=b2f08ed4-e255-4edd-85fe-de56c2792720 ro single
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-2.6.32-24-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
        insmod ext2
        set root='(hd0,8)'
        search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
        linux16        /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod ext2
        set root='(hd0,8)'
        search --no-floppy --fs-uuid --set b2f08ed4-e255-4edd-85fe-de56c2792720
        linux16        /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
        linux /boot/vmlinuz-generic-2.6.33.4 root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
        linux /boot/vmlinuz-generic-smp-2.6.33.4-smp root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
        linux /boot/vmlinuz-huge-2.6.33.4 root=/dev/sda5
}
menuentry "Slackware Linux (Slackware 13.1.0) (on /dev/sda5)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set da42e122-79d6-4215-aa8c-7b42cdfe8876
        linux /boot/vmlinuz-huge-smp-2.6.33.4-smp root=/dev/sda5
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###


T3slider 01-02-2011 11:29 PM

If you have to ask whether you should use the SMP version or the non-SMP version, you haven't read CHANGES_AND_HINTS.TXT. This should be considered mandatory reading and answers a lot of standard installation questions.

Quote:

Originally Posted by CHANGES_AND_HINTS.TXT
Use one of the provided generic kernels for daily use. Do not report
bugs until/unless you have reproduced them using one of the stock
generic kernels. You will need to create an initrd in order to boot
the generic kernels - see /boot/README.initrd for instructions.
The huge kernels are primarily intended as "installer" and "emergency"
kernels in case you forget to make an initrd. For most systems, you
should use the generic SMP kernel if it will run, even if your system is
not SMP-capable. Some newer hardware needs the local APIC enabled in the
SMP kernel, and theoretically there should not be a performance penalty
with using the SMP-capable kernel on a uniprocessor machine, as the SMP
kernel tests for this and makes necessary adjustments. Furthermore, the
kernel sources shipped with Slackware are configured for SMP usage, so you
won't have to modify those to build external modules (such as NVidia or
ATI proprietary drivers) if you use the SMP kernel.

If you decide to use one of the non-SMP kernels, you will need to follow the
instructions in /extra/linux-2.6.33.4-nosmp-sdk/README.TXT to modify your
kernel sources for non-SMP usage. Note that this only applies if you are
using the Slackware-provided non-SMP kernel - if you build a custom kernel,
the symlinks at /lib/modules/$(uname -r)/{build,source} will point to the
correct kernel source so long as you don't (re)move it.

If the issue didn't crop up before, then you were probably just using the huge-smp kernel in blissful ignorance. I would still recommend switching to the generic-smp kernel.

Richard Cranium 01-03-2011 12:29 AM

The following script provides slightly more sane grub2 entries than the Debian/Ubuntu script. It's a hacked-up version of the 10_linux script that comes with the grub2 Slackbuild package. It will look for and add initrd lines for generic kernels but not for huge ones. I have a Slackware64 system, so I believe that it would need a slight modification to work correctly for 32 bit Slackware.

(I've got it installed as /etc/grub.d/09_slackware_linux on my machines.)

Code:

#! /bin/sh -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  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}
bindir=${exec_prefix}/bin
libdir=/usr/lib64
. ${libdir}/grub/grub-mkconfig_lib

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=@LOCALEDIR@

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
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}" ; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

linux_entry ()
{
  os="$1"
  tag="$2"
  version="$3"
  recovery="$4"
  args="$5"
  if ${recovery} ; then
    title="$(gettext "%s, with Linux %s [%s] (recovery mode)")"
  else
    title="$(gettext "%s, with Linux %s [%s]")"
  fi
  printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}" "${tag}"
  save_default_entry | sed -e "s/^/\t/"

  # Use ELILO's generic "efifb" when it's known to be available.
  # FIXME: We need an interface to select vesafb in case efifb can't be used.
  if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
      if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
          && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
          cat << EOF
        set gfxpayload=keep
EOF
      fi
  else
          cat << EOF
        set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
EOF
  fi

  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}"
  cat << EOF
        echo        $(printf "$(gettext "Loading Linux %s ...")" ${version})
        linux        ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
  if test -n "${initrd}" ; then
    cat << EOF
        echo        $(gettext "Loading initial ramdisk ...")
        initrd        ${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}


generate_entries ()
{
    mylist="$1"
    tag="$1"
    initrd_allowed="$2"
    mylist=`for i in /boot/vmlinu[xz]-${tag}-* /vmlinu[xz]-${tag}-* ; do
              if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
            done`
    while [ "x$mylist" != "x" ] ; do
        linux=`version_find_latest $mylist`
        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=
        if [ "x${initrd_allowed}" = "xtrue" ]; then
            for i in "initrd-${version}.gz" "initrd.gz" \
                "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
        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}" "${tag}" "${version}" false \
            "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
        if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
            linux_entry "${OS}" "${tag}" "${version}" true \
                "su ${GRUB_CMDLINE_LINUX}"
        fi

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

prepare_boot_cache=

generate_entries "generic" "true"

generate_entries "huge" "false"

The output from it looks like...
Code:

### BEGIN /etc/grub.d/09_slackware_linux ###
menuentry "Slackware-13.1.0 GNU/Linux, with Linux 2.6.33.4 [generic]" --class slackware-13.1.0 --class gnu-linux --class gnu --class os {
        insmod ext2
        set root='(hd3,1)'
        search --no-floppy --fs-uuid --set d51812c8-3c6c-407d-bfd0-f220ce33f53c
        echo        Loading Linux 2.6.33.4 ...
        linux        /vmlinuz-generic-2.6.33.4 root=/dev/mapper/mdgroup-rootlv ro vga=794
        echo        Loading initial ramdisk ...
        initrd        /initrd.gz
}
menuentry "Slackware-13.1.0 GNU/Linux, with Linux 2.6.33.4 [generic] (recovery mode)" --class slackware-13.1.0 --class gnu-linux --class gnu --class os {
        insmod ext2
        set root='(hd3,1)'
        search --no-floppy --fs-uuid --set d51812c8-3c6c-407d-bfd0-f220ce33f53c
        echo        Loading Linux 2.6.33.4 ...
        linux        /vmlinuz-generic-2.6.33.4 root=/dev/mapper/mdgroup-rootlv ro su vga=794
        echo        Loading initial ramdisk ...
        initrd        /initrd.gz
}
menuentry "Slackware-13.1.0 GNU/Linux, with Linux 2.6.33.4 [huge]" --class slackware-13.1.0 --class gnu-linux --class gnu --class os {
        insmod ext2
        set root='(hd3,1)'
        search --no-floppy --fs-uuid --set d51812c8-3c6c-407d-bfd0-f220ce33f53c
        echo        Loading Linux 2.6.33.4 ...
        linux        /vmlinuz-huge-2.6.33.4 root=/dev/mapper/mdgroup-rootlv ro vga=794
}
menuentry "Slackware-13.1.0 GNU/Linux, with Linux 2.6.33.4 [huge] (recovery mode)" --class slackware-13.1.0 --class gnu-linux --class gnu --class os {
        insmod ext2
        set root='(hd3,1)'
        search --no-floppy --fs-uuid --set d51812c8-3c6c-407d-bfd0-f220ce33f53c
        echo        Loading Linux 2.6.33.4 ...
        linux        /vmlinuz-huge-2.6.33.4 root=/dev/mapper/mdgroup-rootlv ro su vga=794
}
### END /etc/grub.d/09_slackware_linux ###

The script does not do any error checking. Use with caution.

Ubunoob001 01-03-2011 09:05 AM

Quote:

Originally Posted by T3slider (Post 4210913)
I believe GRUB just detected all of the kernel images in /boot, and setup listings for each of them. 1. and 2. would be the generic and generic-smp kernels (assuming you're using 32-bit Slackware...), both of which require an initrd. Read /boot/README.initrd and try to switch to the generic-smp kernel (read CHANGES_AND_HINTS.TXT on the install media or on your favourite mirror for information).

(found in next post):

If you have to ask whether you should use the SMP version or the non-SMP version, you haven't read CHANGES_AND_HINTS.TXT. This should be considered mandatory reading and answers a lot of standard installation questions.

If the issue didn't crop up before, then you were probably just using the huge-smp kernel in blissful ignorance. I would still recommend switching to the generic-smp kernel.


Will get to that today. Thanks for the direction, as well as the helpful diagnostic in your previous reply to this thread.

And thanks also to richard cranium for suggestions.

Since I now have an idea what is causing the menu issues (see T3sliders earlier post) , and have guidance as to where to go for additional information (quoted text above) this thread is marked as solved.

Drakeo 01-03-2011 01:54 PM

Quote:

please read this post from me about multiple disk and grub2 and edit mode.
here is the link


All times are GMT -5. The time now is 07:50 AM.