Announcement

Collapse
No announcement yet.

Grub2 and a small question

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

    Grub2 and a small question

    As you all can see here:
    http://kubuntuforums.net/forums/inde...;topicseen#new

    I had a few problems with netbook karmic and grub2 that were finally resolved, or almost

    That is the reason for this Thread.

    According to this:
    http://ubuntuforums.org/showthread.php?t=1195275

    The grub.cfg should not be edited manually.
    One should edit one of the /etc/grub.d/files.

    This is where it becomes confusing.

    My machine has ubuntu on sda1 and Kubuntu karmic on sda3

    So I should have one Kubuntu karmic and one ubuntu, right?
    Wrong.

    I have two ubuntu's:
    The relevant grub.cfg is attached below

    The first ubuntu recorded by /etc/grub.d/30_os-prober points to my swap partition.

    The second ubuntu recorded by /etc/grub.d/30_otheros points to the correct partition.

    So, something in the /etc/grub.d/30_os-prober file is obviously wrong but I cannot figure out what it is.

    For reference I have attached the
    /etc/grub.d/30_os-prober file below.

    Grub legacy was a lot easier

    Any ideas?
    Attached Files
    HP Pavilion dv6 core i7 (Main)
    4 GB Ram
    Kubuntu 18.10

    #2
    Re: Grub2 and a small question

    Is that your entire/original grub.cfg ?

    It seems to be missing the top (header, theme, linux). The top at here:
    #
    # 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 ###
    set default=0
    set timeout=5
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
    if loadfont /usr/share/grub/ascii.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
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=cyan/blue
    set menu_color_highlight=white/blue
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, Linux 2.6.31-4-generic" {
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
    linux /boot/vmlinuz-2.6.31-4-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro quiet splash
    initrd /boot/initrd.img-2.6.31-4-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-4-generic (recovery mode)" {
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
    linux /boot/vmlinuz-2.6.31-4-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro single
    initrd /boot/initrd.img-2.6.31-4-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-3-generic" {
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
    linux /boot/vmlinuz-2.6.31-3-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro quiet splash
    initrd /boot/initrd.img-2.6.31-3-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-3-generic (recovery mode)" {
    set root=(hd1,1)
    search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
    linux /boot/vmlinuz-2.6.31-3-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro single
    initrd /boot/initrd.img-2.6.31-3-generic
    }
    ### END /etc/grub.d/10_linux ###
    What do you have at the /etc/grub.d ?. At here: 00_header 05_debian_theme 10_linux 20_memtest86+ 30_os-prober 30_otheros 40_custom.

    If you have all those you could try to rebuild the grub.cfg with the command:
    Code:
    sudo update-grub2
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Re: Grub2 and a small question

      Originally posted by Fintan

      So I should have one Kubuntu karmic and one ubuntu, right?
      Wrong.

      I have two ubuntu's:
      The relevant grub.cfg is attached below

      The first ubuntu recorded by /etc/grub.d/30_os-prober points to my swap partition.

      The second ubuntu recorded by /etc/grub.d/30_otheros points to the correct partition.
      Fintan, thanks for experimenting with Grub2 -- maybe you'll save the rest of us some grief!


      OK, I think you do have Ubuntu and Kubuntu, but with the menu pointing to the wrong partition. Kubuntu has always been identified by Grub as "Ubuntu" on the menu -- the kernel is the same on both.

      So, use "blkid" to get the correct UUID for the partition where Kubuntu lives, and then edit the menu to reflect it correctly in both places:
      title Ubuntu 9.04, kernel 2.6.28-14-generic
      uuid 2a5c02ca-bf06-4b1c-9f2c-ba0454bbc83b
      kernel /boot/vmlinuz-2.6.28-14-generic root=UUID=2a5c02ca-bf06-4b1c-9f2c-ba0454bbc83b ro quiet splash
      initrd /boot/initrd.img-2.6.28-14-generic
      quiet

      Comment


        #4
        Re: Grub2 and a small question

        If the problem is the double markings: 30_os-prober vs 30_otheros then you could clean the 30_otheros file so that it only have:
        Code:
        #!/bin/sh
        exec tail -n +3 $0
        and rebuild the grub.cfg
        Before you edit, BACKUP !

        Why there are dead links ?
        1. Thread: Please explain how to access old kubuntu forum posts
        2. Thread: Lost Information

        Comment


          #5
          Re: Grub2 and a small question Updated

          @rog:
          Thank you but yes that is the whole grub.cfg.

          In the mean time I played a little and did a dist-upgrade of ubutnu which gave me the final release of juanty and the latest 9.04 kernel.

          This is the new grub.cfg after removing old kernels from Ubuntu and KK and sudo update-grub:

          # 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 ###
          set default=0
          set timeout=5
          set root=(hd0,7)
          search --no-floppy --fs-uuid --set 81c5b42f-4f49-44c8-becd-1217a5c0fa9d
          if loadfont /usr/share/grub/ascii.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
          ### END /etc/grub.d/00_header ###

          ### BEGIN /etc/grub.d/05_debian_theme ###
          set root=(hd0,3)
          search --no-floppy --fs-uuid --set aafa3492-4ede-4f3b-bd0f-cef789423981
          insmod tga
          if background_image /images/backgroundfintan1.tga ; then
          set color_normal=black/black
          set color_highlight=magenta/black
          else
          set menu_color_normal=cyan/blue
          set menu_color_highlight=white/blue
          fi
          ### END /etc/grub.d/05_debian_theme ###

          ### BEGIN /etc/grub.d/10_linux ###
          menuentry "Ubuntu, Linux 2.6.31-4-generic" {
          set root=(hd0,3)
          search --no-floppy --fs-uuid --set aafa3492-4ede-4f3b-bd0f-cef789423981
          linux /vmlinuz-2.6.31-4-generic root=UUID=81c5b42f-4f49-44c8-becd-1217a5c0fa9d ro quiet splash
          initrd /initrd.img-2.6.31-4-generic
          }
          menuentry "Ubuntu, Linux 2.6.31-4-generic (recovery mode)" {
          set root=(hd0,3)
          search --no-floppy --fs-uuid --set aafa3492-4ede-4f3b-bd0f-cef789423981
          linux /vmlinuz-2.6.31-4-generic root=UUID=81c5b42f-4f49-44c8-becd-1217a5c0fa9d ro single
          initrd /initrd.img-2.6.31-4-generic
          }
          ### END /etc/grub.d/10_linux ###

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

          ### BEGIN /etc/grub.d/30_os-prober ###
          menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (on /dev/sda1)" {
          set root=(hd0,1)
          search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
          linux /boot/vmlinuz-2.6.28-13-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro quiet splash
          initrd /boot/initrd.img-2.6.28-13-generic
          }
          menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (recovery mode) (on /dev/sda1)" {
          set root=(hd0,1)
          search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
          linux /boot/vmlinuz-2.6.28-13-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro single
          initrd /boot/initrd.img-2.6.28-13-generic
          }
          menuentry "Ubuntu 9.04, memtest86+ (on /dev/sda1)" {
          set root=(hd0,1)
          search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
          linux /boot/memtest86+.bin
          }
          ### END /etc/grub.d/30_os-prober ###

          ### BEGIN /etc/grub.d/30_otheros ###

          # This entry automatically added by the Debian installer for an existing
          # linux installation on /dev/sda1.
          menuentry "Ubuntu jaunty (development branch), kernel 2.6.28-9-generic (on /dev/sda1)" {
          set root=(hd0,1)
          search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
          linux /boot/vmlinuz-2.6.28-9-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro quiet splash
          initrd /boot/initrd.img-2.6.28-9-generic
          }


          # This entry automatically added by the Debian installer for an existing
          # linux installation on /dev/sda1.
          menuentry "Ubuntu jaunty (development branch), kernel 2.6.28-9-generic (recovery mode) (on /dev/sda1)" {
          set root=(hd0,1)
          search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
          linux /boot/vmlinuz-2.6.28-9-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro single
          initrd /boot/initrd.img-2.6.28-9-generic
          }


          # This entry automatically added by the Debian installer for an existing
          # linux installation on /dev/sda1.
          menuentry "Ubuntu jaunty (development branch), memtest86+ (on /dev/sda1)" {
          set root=(hd0,1)
          search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
          linux /boot/memtest86+.bin
          }

          ### END /etc/grub.d/30_otheros ###

          ### BEGIN /etc/grub.d/40_custom ###
          # This file is an example on how to add custom entries
          ### END /etc/grub.d/40_custom ###
          Notice that the ...30_otheros section now points to a kernel that is not there anymore but the uuid's are correct .

          What do you have at the /etc/grub.d ?. At here: 00_header 05_debian_theme 10_linux 20_memtest86+ 30_os-prober 30_otheros 40_custom.
          Yes, I have all of those files in/etc/grub.d

          In the old grub.cfg the 30_otheros section was correct and the 30_os-prober section was off.

          Now 30_otherors is completely off.
          I can edit that though

          @dible thankx for designating me as a good ginnypig

          Ahhh yes, blkid.

          Well that gives nothing in Karmic netbook
          fintan@fintanws3:~$ blkid
          fintan@fintanws3:~$
          Very strange :P

          HP Pavilion dv6 core i7 (Main)
          4 GB Ram
          Kubuntu 18.10

          Comment


            #6
            Re: Grub2 and a small question

            About blkid

            Here, the blkid was just dying without the output. Then i tried:
            Code:
            sudo blkid
            and the normal blkid started to work.

            Very strange


            Maybe you need to make the default cache file /etc/blkid.tab with the "sudo blkid"

            man blkid
            OPTIONS
            -c cachefile

            Read from cachefile instead of reading from the default cache file /etc/blkid.tab. If you want to start with a clean cache (i.e. don't report devices previously scanned but not necessarily available at this time), specify /dev/null.
            Before you edit, BACKUP !

            Why there are dead links ?
            1. Thread: Please explain how to access old kubuntu forum posts
            2. Thread: Lost Information

            Comment


              #7
              Re: Grub2 and a small question

              sudo blkid worked here on the laptop as well.

              The desktop reacts normaly
              HP Pavilion dv6 core i7 (Main)
              4 GB Ram
              Kubuntu 18.10

              Comment


                #8
                Re: Grub2 and a small question

                Yes, the /etc/blkid.tab file is "built" once and then sits there unchanged in subsequent bootups. So you really need to
                Code:
                sudo rm /etc/blkid.tab
                and then run
                Code:
                sudo blkid
                to get the "current" values of device UUIDs.

                Comment


                  #9
                  Re: Grub2 and a small question

                  Grub2 on karmic alpha5 with travelmate 4021 does not recognize all OS's until you run:
                  Code:
                  sudo update-grub
                  HP Pavilion dv6 core i7 (Main)
                  4 GB Ram
                  Kubuntu 18.10

                  Comment


                    #10
                    Re: Grub2 and a small question

                    Originally posted by Fintan
                    Grub2 on karmic alpha5 with travelmate 4021 does not recognize all OS's until you run:
                    Code:
                    sudo update-grub
                    I have a similar setup: Kubuntu 9.04 on /dev/sda1 and Kubuntu 9.10 on /dev/sda5. Jaunty uses grub, Karmic uses grub2.
                    Jaunty's menu.lst had 9 kernel updates, each with an additional "recover" option. Karmic had only one kernel and its recovery option.

                    The first problem I noticed, and mentioned on this forum previously, was that while grub2 boot screen had the correct kernel assignment for Karmic, and it would boot fine, and it gave correct listings for the 9 Jaunty kernels, only the oldest kernel would boot, regardless of which one I selected during bootup. Also, after the first Karmic kernel update, several of the Jaunty kernels were no longer listed (or were not in the visible part of the boot "window").

                    I first tried to edit menu.lst. Removing the kernels didn't work because it was obvious that grub2 was dynamically reading their existance, not reading menu.lst. Using the SystemSettings "Update Grub2" option failed with a message "Menu.list does not exist", or something like that, but it would install an empty menu.lst file in my Karmic /boot/grub directory.

                    What I did to clear things up was to first boot into Jaunty and use Synaptic to remove EVERY kernel except 2.6.30, then reboot into Karmic and run "sudo update-grub". Now both work correctly and I can boot the latest kernel in each.

                    However, Karmic is running SO SMOOTHLY that I don't spend any time in Jaunty any more. As far as the performance of my Sony VAIO VGN-FW140E/H notebook is concerned, running the 64b Karmic is a VAST improvement over the 32bit Jaunty, and Jaunty wasn't shabby, either.
                    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                    – John F. Kennedy, February 26, 1962.

                    Comment


                      #11
                      Re: Grub2 and a small question

                      IIRC, there has been some discussion on an incompatibility issue with Grub 2 and Grub (legacy) installations. I think Qqmike has commented 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

                      Working...
                      X