Announcement

Collapse
No announcement yet.

HELP: Grub error: you need to load the kernel first

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

    HELP: Grub error: you need to load the kernel first

    I just changed both my disks, 2 SATA drives. Then I installed Windows on /dev/sda and Karmic on /dev/sdb. All worked well.

    Then I added a partition on sda and installed a second Karmic (backup) there. It also worked well.

    Then I booted Gparted and added a partition at the end of /deb/sdb.

    Now I can boot the new Kubuntu on /dev/sda, but when I pick the one on /dev/sdb in Grub, I get the above error: You need to load the kernel first.

    I don't know if the problem came about because of the additional Kubuntu system of the added partition.

    I suppose I am in Grub2, but I have managed to stay fairly ignorant of Grub and its workings ... up til now.

    Here is my grub.cfg:

    /boot/grub$ cat grub.cfg
    #
    # 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 /boot/grub/grubenv ]; then
    have_grubenv=true
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    saved_entry=${prev_saved_entry}
    save_env saved_entry
    prev_saved_entry=
    save_env prev_saved_entry
    fi
    insmod ext2
    set root=(hd0,2)
    search --no-floppy --fs-uuid --set 4556eed5-9fca-40d7-a19c-bc21790f52bc
    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
    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/white
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, Linux 2.6.31-14-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd0,2)
    search --no-floppy --fs-uuid --set 4556eed5-9fca-40d7-a19c-bc21790f52bc
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4556eed5-9fca-40d7-a19c-bc21790f52bc ro quiet splash
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd0,2)
    search --no-floppy --fs-uuid --set 4556eed5-9fca-40d7-a19c-bc21790f52bc
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4556eed5-9fca-40d7-a19c-bc21790f52bc ro single
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
    insmod ntfs
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set a618a12f18a0ff83
    drivemap -s (hd0) ${root}
    chainloader +1
    }
    menuentry "Ubuntu, Linux 2.6.31-17-generic (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set 1e181bc6-2eac-4433-adb8-59cc50d84075
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=1e181bc6-2eac-4433-adb8-59cc50d84075 ro quiet splash
    initrd /boot/initrd.img-2.6.31-17-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-17-generic (recovery mode) (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set 1e181bc6-2eac-4433-adb8-59cc50d84075
    linux /boot/vmlinuz-2.6.31-17-generic root=UUID=1e181bc6-2eac-4433-adb8-59cc50d84075 ro single
    initrd /boot/initrd.img-2.6.31-17-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set 1e181bc6-2eac-4433-adb8-59cc50d84075
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=1e181bc6-2eac-4433-adb8-59cc50d84075 ro quiet splash
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode) (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set 1e181bc6-2eac-4433-adb8-59cc50d84075
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=1e181bc6-2eac-4433-adb8-59cc50d84075 ro single
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    ### 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 ###

    Another post made me think this might be important, but I do not know what to make of it:

    /boot/grub$ sudo blkid -c /dev/null
    /dev/sda1: UUID="A618A12F18A0FF83" TYPE="ntfs"
    /dev/sda2: UUID="4556eed5-9fca-40d7-a19c-bc21790f52bc" TYPE="ext3"
    /dev/sda3: UUID="bbf1b63a-bc8e-4716-b64c-96304e2fa73f" SEC_TYPE="ext2" TYPE="ext3"
    /dev/sda5: UUID="3a6e6e4e-c7e0-4ba0-8ca2-ba6b16f30fc4" SEC_TYPE="ext2" TYPE="ext3"
    /dev/sda6: UUID="33ce7944-af41-4bad-bddb-2f82a6cf1d13" SEC_TYPE="ext2" TYPE="ext3"
    /dev/sdb1: UUID="ff960a6d-637c-4b15-b606-7d9de4107582" SEC_TYPE="ext2" TYPE="ext3"
    /dev/sdb2: UUID="1e181bc6-2eac-4433-adb8-59cc50d84075" TYPE="ext3"
    /dev/sdb3: UUID="0c26d059-2639-4f77-bf7f-6dc30e402854" TYPE="swap"
    /dev/sdb5: UUID="6900cfe5-d288-4cfb-8918-bd5613ddc0f1" SEC_TYPE="ext2" TYPE="ext3"
    /dev/sdb6: UUID="9010e109-01f1-4c7c-a04f-80fc6bdfef59" SEC_TYPE="ext2" TYPE="ext3"
    /dev/sdb7: UUID="49937d79-2912-4803-b397-b9eef0794050" SEC_TYPE="ext2" TYPE="ext3"
    'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

    #2
    Re: HELP: Grub error: you need to load the kernel first

    I should have mentioned that the system on sdb has a separate boot partition:

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 64 514048+ 83 Linux
    /dev/sdb2 65 2056 16000740 83 Linux
    /dev/sdb3 2057 2554 4000185 82 Linux swap / Solaris

    sdb1 is /boot and sdb2 is /. ISo tried diddling grub.cfg to tell it to use sdb1 instead of sdb2, but got the same result. I am not at all sure I did it right, tho.

    $ diff grub.cfg grub.cfg.ORG
    86,88c86,88
    < set root=(hd1,1)
    < search --no-floppy --fs-uuid --set ff960a6d-637c-4b15-b606-7d9de4107582
    < linux /boot/vmlinuz-2.6.31-17-generic root=UUID=ff960a6d-637c-4b15-b606-7d9de4107582 ro quiet splash
    ---
    > set root=(hd1,2)
    > search --no-floppy --fs-uuid --set 1e181bc6-2eac-4433-adb8-59cc50d84075
    > linux /boot/vmlinuz-2.6.31-17-generic root=UUID=1e181bc6-2eac-4433-adb8-59cc50d84075 ro quiet splash

    'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

    Comment


      #3
      Re: HELP: Grub error: you need to load the kernel first

      Perhaps I should mention that the sdb system is updated to vmlinuz-2.6.31-17 whereas the sda system is at vmlinuz-2.6.31-14. Maybe that means two different versions of Grub. To check, I will update the sda system to vmlinuz-2.6.31-17.
      'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

      Comment


        #4
        Re: HELP: Grub error: you need to load the kernel first

        Ha! Updating so as to have the same version of grub on the two systems did the trick.

        But now I have a question. I now have different grub.cfg files on the two systems. How do I get the grub.cfg on the sdb system in sync with the one on sda (which is more recent)? Just copy it? If so, then what?

        Thanks in advance. I don't think I'll find the answer to this one by myself...
        'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

        Comment


          #5
          Re: HELP: Grub error: you need to load the kernel first

          To update a boot menu in GRUB 2, grub.cfg, use
          sudo update-grub
          or
          sudo grub-mkconf

          (Note that
          sudo grub-mkconfig prints its output to the screen (default = stdout). To print to the grub.cfg, use
          sudo grub-mkconfig -o /boot/grub/grub.cfg
          or
          sudo grub-mkconfig --output=/boot/grub/grub.cfg )

          (Boot into Kubuntu to do it; or from a Live CD.)

          I don't see why having different kernel versions or different grub.cfg's should make any difference to anything, frankly, but you fixed your problem, that's what counts. Actually, your problem may have gotten fixed because the system may have run a grub-update in the process of the upgrade, thus fixing a bad grub.cfg (not because you had an old kernel).

          Also, you said "separate boot partition," but I think you just mean separate or dedicated GRUB 2 partition. That is, a boot partition contains the kernel and initrd files and GRUB. A GRUB partition contains ONLY GRUB files. I'm thinking that GRUB 2 is not yet ready to handle a true, full separate /boot partition, but I may be wrong. This how-to shows how to make a separate/dedicated GRUB 2 partition (NOT a full /boot partition). Also see SECTION 3 on Fixing Things:

          GRUB 2 A Guide for Users
          http://kubuntuforums.net/forums/inde...opic=3106368.0
          Also, bookmark the reference to drs305 how-to at Ubuntu--very good for grub.cfg issues.

          Nice work there with your GRUB 2, btw!

          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            Re: HELP: Grub error: you need to load the kernel first

            Originally posted by Qqmike
            I don't see why having different kernel versions or different grub.cfg's should make any difference to anything, frankly, but you fixed your problem, that's what counts. Actually, your problem may have gotten fixed because the system may have run a grub-update in the process of the upgrade, thus fixing a bad grub.cfg (not because you had an old kernel).
            I agree.

            Also, you said "separate boot partition," but I think you just mean separate or dedicated GRUB 2 partition.
            I meant that /boot is on one partition, what the installer calls /boot. It contains /boot/grub/grub.cfg, of course, as well as vmlinuz... (Why the "z"?)

            Thanks for the suggestions. Will take a look. I do think, tho, that I need to get agreement between the two systems. Also, I would like to change the default boot system.
            'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

            Comment


              #7
              Re: HELP: Grub error: you need to load the kernel first

              The "z" in vmlinuz ...
              The name vmlinux is a mutation of vmunix, while in vmlinuz the letter z at the end denotes that it is compressed.
              http://en.wikipedia.org/wiki/Vmlinuz


              "Also, I would like to change the default boot system."
              The links will show how (edit /etc/default/grub file).


              So you DO actually have a FULL real /boot partition kernel and all. Good. Glad it works right!
              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: HELP: Grub error: you need to load the kernel first

                I have a super Grub disc, but that is probably Grub 1. Is there a similar thing for Grub 2?

                I'm a bit concerned that if I reconfigure Grub with the sdb system, I'll get something that won't work, as the current, working version was made with the system on sda. Still, they are the same thing now...

                Your Grub Guide for Users is marvellous, as others have pointed out. Do you have a version of it with everything in order, so we can avoid reading 6 pages of posts? I know, I'm being difficult...

                In any case, thanks a million.
                'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

                Comment


                  #9
                  Re: HELP: Grub error: you need to load the kernel first

                  Me, again. Sorry.

                  I have rerun 'sudo update-grub' on the system on sdb. It found the sda systems (which were installed later) and added them to its grub.cfg, with its own (sdb) entries first.

                  $ grep menuent grub.cfg
                  menuentry "Ubuntu, Linux 2.6.31-17-generic" {
                  menuentry "Ubuntu, Linux 2.6.31-17-generic (recovery mode)" {
                  menuentry "Ubuntu, Linux 2.6.31-14-generic" {
                  menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
                  menuentry "Memory test (memtest86+)" {
                  menuentry "Memory test (memtest86+, serial console 115200)" {
                  menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
                  menuentry "Ubuntu, Linux 2.6.31-17-generic (on /dev/sda2)" {
                  menuentry "Ubuntu, Linux 2.6.31-17-generic (recovery mode) (on /dev/sda2)" {
                  menuentry "Ubuntu, Linux 2.6.31-14-generic (on /dev/sda2)" {
                  menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode) (on /dev/sda2)" {


                  However, when I reboot, I see the systems in the previous order, that of the sda system. Is the sdb system writing to a different disk? Or is there another command for actually updating the grub boot menu?
                  'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

                  Comment


                    #10
                    Re: HELP: Grub error: you need to load the kernel first

                    In a system with more than one Kubuntu installed (like yours), you need to decide which Kubuntu's GRUB will "control" the boot show. Then make sure that you use THAT GRUB to install to the MBR of the first BIOS boot drive.

                    Example
                    Suppose you wish to use the sdb Kubuntu to run the boot show and so will use "its" GRUB files. And suppose the sda hard drive is set in your BIOS as the first boot drive. Then when you install or re-install GRUB, make sure you do so FROM the GRUB on sdb TO the MBR of sda.

                    In your case, GRUB 2 MAY be getting confused because of the separate /boot partition, I'm really not sure, frankly. Btw, there is no reason to use a separate boot partition, not on your simple and modern system (where your BIOS has no trouble accessing all disk cylinders). Using a separate GRUB partition makes sense for some people, though, people who are going to have a lots of Linux OSs on their system. However, I'm hearing that GRUB 2 may have issues with things like updating the boot menu in such cases (where the GRUB files/boot menu are on another partition). That's why some folks (like me) who use a separate GRUB 2 partition, make their own custom, manual grub.cfg in the separate GRUB partition and do NOT benefit from all the automatic updating features of the new GRUB 2 if they used a standard setup.

                    Keep in mind, if you want to play with this some more, that GRUB 2 does have some features you can try.

                    > To update the boot menu:
                    sudo grub-mkconfig -o /boot/grub/grub.cfg
                    (which should ( ? ) tell GRUB 2 to write the new grub.cfg to the current /boot partition associated with the Kubuntu you are in at the moment).

                    > To install GRUB 2 files:
                    sudo grub-install --root-directory=/media/mountpoint /dev/sdx
                    (where the GRUB files to be used are in the /media/mountpoint directory and sdx is the first BIOS boot drive (or the drive you wish to install GRUB files to); you can also use /dev/sdxn to install GRUB to some partition of the sdx disk)
                    This is under the topics "Flash Drive and "Separate GRUB 2 partition."

                    SGD does have a GRUB 2 -based version (you'll see it in the download list) However, I'm not sure how well developed it is yet. You can post a question at the SGD forum and probably get the scoop on it.

                    As for my rambling GRUB 2 Guide, ha!, who knows. I quit using GRUB 2 a few months ago because it was giving me so many "issues" to deal with. The devs are working out the bugs, continuing. They have not yet done any serious work on the official Manual. So I will wait and see how GRUB 2 progresses before jumping in again. I'm working on some other Linux things right now and need a solid system to work in (thus, my 8.04.3 with GRUB Legacy). I haven't had time to spend on GRUB 2. People who have a standard setup--one HDD, one Kubuntu--seem to be doing just fine with it and are very happy with their 9.10 + GRUB 2. Unfortunately, my system is never so simple ... Doesn't sound like yours is either! But I think you can iron out the wrinkles in yours, using the principles I mentioned above. Keep us posted. And MAYBE someone else here has implemented a separate /boot GRUB 2 system, who knows.

                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment


                      #11
                      Re: HELP: Grub error: you need to load the kernel first

                      Thanks for you long reply. Very nice.

                      My only concern now is to get my sdb system, which is the main one (sda is a backup sytsem on the Windows disk), to write on sda. It doesn't seem to be doing so. Will post more when (if?) I resolve that.

                      Thanks again.
                      'I must have a prodigious quantity of mind; it takes me as much as a week sometimes to make it up.' Mark Twain

                      Comment


                        #12
                        Re: HELP: Grub error: you need to load the kernel first

                        Boy, I'm hesitant to be too specific (with GRUB 2 and someone else's system) like this, but I'm thinking along these lines:

                        sudo grub-install --root-directory=/media/mountpoint /dev/sda

                        where you are doing this while in your sdb Kubuntu at Konsole;
                        where /media/mountpoint is the mount point for your separate boot partition;
                        Ex., if you are in your sdb Kubuntu, your /boot may be mounted as, say, /media/mybootpartition, or maybe /media/sdb1, like this:
                        sudo grub-install --root-directory=/media/sdb1 /dev/sda
                        That should use the GRUB files in sdb1 to install GRUB 2 to the MBR of sda.
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment

                        Working...
                        X