Announcement

Collapse
No announcement yet.

How to configure grub? Cannot find menu.lst or grub.conf

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to configure grub? Cannot find menu.lst or grub.conf

    Hello.

    I am running Kubuntu 9.10 and trying to configure my boot loader settings, but I cannot figure out where to do this. As far as I understand I am supposed to have a file named manu.lst or grub.conf in my /boot/grub folder, but I cannot find either file. All I have in the folder in question is this:

    Code:
    ore@ore-desktop:~$ ls /boot/grub/
    915resolution.mod boot.img    datehook.mod fat.mod   hdparm.mod   loadenv.mod  multiboot.mod  password.mod scsi.mod   ufs2.mod     videotest.mod
    acpi.mod      boot.mod    date.mod   font.mod   hello.mod   loopback.mod  normal.mod   pci.mod    search.mod  uhci.mod     xfs.mod
    affs.mod      bsd.mod     datetime.mod fs_file.mod help.mod    lsmmap.mod   ntfscomp.mod  play.mod   serial.mod  unicode.pf2    xnu.mod
    afs_be.mod     bufio.mod    device.map  fshelp.mod  hexdump.mod  ls.mod     ntfs.mod    png.mod    setjmp.mod  usb_keyboard.mod xnu_uuid.mod
    afs.mod      cat.mod     diskboot.img fs.lst    hfs.mod    lspci.mod   ohci.mod    probe.mod   sfs.mod    usb.mod      zfsinfo.mod
    aout.mod      cdboot.img   dm_nv.mod   fs_uuid.mod hfsplus.mod  lvm.mod    part_acorn.mod pxeboot.img  sh.mod    usbms.mod     zfs.mod
    ata.mod      chain.mod    drivemap.mod gfxterm.mod iso9660.mod  mdraid.mod   part_amiga.mod pxecmd.mod  sleep.mod   usbtest.mod
    ata_pthru.mod   cmp.mod     echo.mod   gptsync.mod jfs.mod    memdisk.mod  part_apple.mod pxe.mod    tar.mod    vbeinfo.mod
    at_keyboard.mod  command.lst   efiemu32.o  grub.cfg   jpeg.mod    memrw.mod   part_gpt.mod  raid5rec.mod terminfo.mod vbe.mod
    befs_be.mod    configfile.mod efiemu64.o  grubenv   kernel.img   minicmd.mod  partmap.lst   raid6rec.mod test.mod   vbetest.mod
    befs.mod      core.img    efiemu.mod  gzio.mod   keystatus.mod minix.mod   part_msdos.mod raid.mod   tga.mod    vga.mod
    biosdisk.mod    cpio.mod    elf.mod    halt.mod   linux16.mod  mmap.mod    part_sun.mod  read.mod   true.mod   vga_text.mod
    bitmap.mod     cpuid.mod    ext2.mod   handler.lst linux.mod   moddep.lst   parttool.lst  reboot.mod  udf.mod    video_fb.mod
    blocklist.mod   crc.mod     extcmd.mod  handler.mod lnxboot.img  msdospart.mod parttool.mod  reiserfs.mod ufs1.mod   video.mod
    ore@ore-desktop:~$
    Grub works perfectly fine. I just cannot figure out how to configure it. Can anyone help me?

    Thanks in advance.

    #2
    Re: How to configure grub? Cannot find menu.lst or grub.conf

    See Qqmikes GRUB 2: A Guide for Users
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: How to configure grub? Cannot find menu.lst or grub.conf

      Originally posted by Snowhog
      Thanks. I will try that.

      Comment


        #4
        Re: How to configure grub? Cannot find menu.lst or grub.conf

        I read the doc, and it's ridiculous! The doc tells me I can't edit /boot/grub/grub.cfg. I can edit /etc/grub/default, but that doesn't help because there are no entries for the OSs in there. All I want to do is remove two obsolete entries, but they don't appear in the files I'm allowed to edit.

        It used to be trivial to edit the GRUB menu, now it doesn't seem possible. This is an upgrade? :P
        Kubuntu #19517 (but of course I am not a number, I am a free man!)

        Comment


          #5
          Re: How to configure grub? Cannot find menu.lst or grub.conf

          This Ubuntu wiki may be easier to follow: Grub 2 (1.97~beta4-1ubuntu4)
          Windows no longer obstructs my view.
          Using Kubuntu Linux since March 23, 2007.
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Re: How to configure grub? Cannot find menu.lst or grub.conf

            Sorry, I mis-stated. The doc is fine, it's the situation that's ridiculous. I used to be a tech writer and I know documentation often has to explain situations that are overly complicated, and this is one of those.

            Thanks, I'll check out your pointers.
            Kubuntu #19517 (but of course I am not a number, I am a free man!)

            Comment


              #7
              Re: How to configure grub? Cannot find menu.lst or grub.conf

              and Dave's done a good job specifically with grub.cfg:
              http://ubuntuforums.org/showthread.php?t=1195275

              Any edits you make directly to grub.cfg will most likely be overwritten (=> gone) the next time update-grub (or grub-mkconfig) is run (either by you or by another program, like Synaptic).
              If changes have been made to your system, sometimes to get a new grub.cfg, it works to run
              sudo update-grub
              (or sudo grub-mkconfig -o /boot/grub/grub.cfg)

              Not sure what your situation is, but Dave probably covered it if it deals with grub.cfg.
              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

              Comment


                #8
                Re: How to configure grub? Cannot find menu.lst or grub.conf

                Okay, I've checked out the three links you've provided. All are useful docs with helpful info.

                But the new GRUB has apparently automated the process of finding OSs, eh? I can't find any files that list the various options I'm going to be presented on startup other than the file I'm not supposed to edit.

                Situation: I installed a clean 9.10, not updated but from scratch. That gave me two choices in GRUB (OS plus memtest) plus the (gag) XP I'd already installed. Then I updated with the current bug fixes, which produced two more choices. How can I get rid of the two obsolete ones? I read the docs, and as a tech writer for 16 years and programmer for 9, I can't tell where the data I'm hoping to delete resides. In deletable form, that is. Certainly I can edit the file I'm not supposed to edit, but what kind of system requires me to do that?
                Kubuntu #19517 (but of course I am not a number, I am a free man!)

                Comment


                  #9
                  Re: How to configure grub? Cannot find menu.lst or grub.conf

                  I'm not using Grub 2, but isn't 7. Removing Entries from Grub 2 - in Dave's Grub 2 Basics clear on this?
                  Windows no longer obstructs my view.
                  Using Kubuntu Linux since March 23, 2007.
                  "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                  Comment


                    #10
                    Re: How to configure grub? Cannot find menu.lst or grub.conf

                    Dave's #7 is clearly explained but aimed at Ubuntu users with Synaptic. It doesn't specify which files contain the data I want to delete, and examining them hasn't produced any ideas either. In the relevant directory are these files:

                    00_header
                    05_debian_theme
                    10_linux
                    20_memtest86+
                    30_os-prober
                    40_custom
                    README

                    All but the last are scripts, which you can skip by removing execute permission. But what I want is not to skip all the Linuxes, rather to omit only the obsolete ones, which seem to be included in an on-the-fly generated list rather than a saved one.

                    It's likely I've misunderstood this, because if what I think is true turns out to be so, there's no longer a way to remove irrelevant items from the list that GRUB presents when you boot. And that's hard to believe.

                    So I'll try installing Synaptic and see if I can make his solution work.

                    Thanks again!
                    Kubuntu #19517 (but of course I am not a number, I am a free man!)

                    Comment


                      #11
                      Re: How to configure grub? Cannot find menu.lst or grub.conf

                      Originally posted by cdupree
                      But what I want is not to skip all the Linuxes, rather to omit only the obsolete ones, which seem to be included in an on-the-fly generated list rather than a saved one.
                      By this (the underlined above), are you meaning the 'older' kernels that you have installed on your system? If 'yes,' then editing (I believe) the 10_linux script is what is required and comment out the parts that reference the older kernels.

                      Added:
                      This might be helpful: Mastering Grub 2 The Easy Way
                      Windows no longer obstructs my view.
                      Using Kubuntu Linux since March 23, 2007.
                      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                      Comment


                        #12
                        Re: How to configure grub? Cannot find menu.lst or grub.conf

                        Basically yes. I installed from the CD, which gave me one kernel and one memtest. Then as soon as I finished installing I did the required updates, which gave me another kernel and another memtest. With the XP entry I have five, which isn't too bad, but when I update again I'll have seven, and won't it get out of hand pretty soon?

                        Your proposed solution makes sense in the abstract, but I've appended the contents of the 10_linux script, and as far as I can see there's no mention of any particular kernel, only a description of how to find them. Am I missing something?

                        - ced


                        _________________________________________________

                        #! /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
                        Kubuntu #19517 (but of course I am not a number, I am a free man!)

                        Comment


                          #13
                          Re: How to configure grub? Cannot find menu.lst or grub.conf

                          Blech! Seeing the script really enforces my strong desire to stick with Grub legacy as long as possible.

                          This post might be of interest to you: #howmany for grub 2
                          Windows no longer obstructs my view.
                          Using Kubuntu Linux since March 23, 2007.
                          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                          Comment


                            #14
                            Re: How to configure grub? Cannot find menu.lst or grub.conf

                            Downloading Synaptic and following the directions you linked to removed the obsolete kernel entries. But chmod'ing the executable bit off the script didn't prevent the memtest stuff from showing up, not that this matters.

                            So I consider the new GRUB to suck royally, but I'm not quite as bad off as I thought. Thanks for the pointers!
                            Kubuntu #19517 (but of course I am not a number, I am a free man!)

                            Comment


                              #15
                              Re: How to configure grub? Cannot find menu.lst or grub.conf

                              The easiest way to remove "obsolete" kernel entries is to remove the "obsolete" kernel image packages with your chosen package manager...this will automatically remove the entries from grub.

                              Grub2 takes a little re-learning, but grub wasn't all bliss either. The Debian way of configuring grub with the configuration and the actual menu items in the same file (with the single/double commenting) has caused some headache for some users I'm sure.

                              I like the idea of having separate files for the finished menu configuration (/boot/grub/grub.cfg), the scripts/rules to create one (/etc/grub.d/*) and the configuration options (/etc/default/grub).

                              Ideally, one should be able to only edit configuration in /etc/default/grub...and let the automagiks handle the rest. I don't think Grub2 is there yet, but it's the way forward to reaching that goal.

                              Comment

                              Working...
                              X