Announcement

Collapse
No announcement yet.

Who has mastered Grub2?

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

    Who has mastered Grub2?

    OK, I installed an Alpha daily image today, and it is updated and working just fine. No issues with audio or video or compiz or anything like that.

    However, Grub2 is kicking my butt!

    There's a Debian installation on a different hard drive on my system. It was not picked up during Karmic installation. I studied the Grub 2 information, and learned I needed to edit the file /etc/grub.d/40_custom, and then run
    Code:
    sudo update-grub2
    So, I did that. Sure enough, my other OS appeared in the file /boot/grub/grub.cfg. Here it is:

    #
    # 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,1)
    search --no-floppy --fs-uuid --set b09c7fff-fbd3-4094-9fe5-de62e35e778f
    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-5-generic" {
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set b09c7fff-fbd3-4094-9fe5-de62e35e778f
    linux /boot/vmlinuz-2.6.31-5-generic root=UUID=b09c7fff-fbd3-4094-9fe5-de62e35e778f ro quiet splash
    initrd /boot/initrd.img-2.6.31-5-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-5-generic (recovery mode)" {
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set b09c7fff-fbd3-4094-9fe5-de62e35e778f
    linux /boot/vmlinuz-2.6.31-5-generic root=UUID=b09c7fff-fbd3-4094-9fe5-de62e35e778f ro single
    initrd /boot/initrd.img-2.6.31-5-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-3-generic" {
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set b09c7fff-fbd3-4094-9fe5-de62e35e778f
    linux /boot/vmlinuz-2.6.31-3-generic root=UUID=b09c7fff-fbd3-4094-9fe5-de62e35e778f ro quiet splash
    initrd /boot/initrd.img-2.6.31-3-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-3-generic (recovery mode)" {
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set b09c7fff-fbd3-4094-9fe5-de62e35e778f
    linux /boot/vmlinuz-2.6.31-3-generic root=UUID=b09c7fff-fbd3-4094-9fe5-de62e35e778f ro single
    initrd /boot/initrd.img-2.6.31-3-generic
    }
    ### END /etc/grub.d/10_linux ###

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

    ### BEGIN /etc/grub.d/30_os-prober ###
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/40_custom ###
    # This file is an example on how to add custom entries
    title Debian sidux GNU/Linux on hd2,1
    configfile (hd2,1)/boot/grub/menu.lst
    ### END /etc/grub.d/40_custom ###
    But, the boot menu that appears on my computer does not show the last stanza -- there's no entry to boot sidux. I also attempted to put the entire sidux boot stanza in the 40_custom file, like this:

    Code:
    title		Debian GNU/Linux, kernel 2.6.30-4.slh.1-sidux-amd64
    root		(hd2,1)
    kernel		/boot/vmlinuz-2.6.30-4.slh.1-sidux-amd64 root=/dev/sdc1 ro quiet vga=791
    initrd		/boot/initrd.img-2.6.30-4.slh.1-sidux-amd64
    Doesn't matter -- it doesn't show up on the boot menu that way either.

    So, have I found a bug, or am I missing something in the new Grub?

    Thanks!

    #2
    Re: Who has mastered Grub2?

    Hey Dible,
    Did you make 40_custom executable?

    Quote:
    * /etc/grub.d/
    o The files in this folder are read during execution of "update-grub" or "update-grub2" commands. The contents are imported into /boot/grub/grub.cfg

    The order of the entries in the grub menu is based on the order of the file names. File named with a starting numeral are run before those beginning with a letter. The order the files are run determines the menu order in grub.cfg.
    Custom entries can be added to the "40_custom" file or in a newly created file.

    Any file created must be executable in order to be included in the grub.cfg file during the "update-grub2" command.
    + 00_header
    + 05_debian_theme: Set background and text colors, themes
    + 10_hurd Locates Hurd kernels
    + 10_linux Locates Linux kernels based on results of the "lsb_release" command.
    + 20_memtest86+: If the file /boot/memtest86+.bin exists, it is included as a menu item.
    + 30_os-prober: Searches for other OS's and includes them in the menu.
    + 40_custom: A template for adding custom menu entries which will be inserted into grub.cfg upon execution of the "update-grub2" command. This and any other custom file must be made executable to allow importation into grub.cfg.
    form here:
    http://ubuntuforums.org/showthread.php?t=1195275

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

    Comment


      #3
      Re: Who has mastered Grub2?

      Yep
      Code:
      sudo chmod +x 40_custom
      That part of it works correctly. When I run
      Code:
      sudo update-grub2
      it picks up the 40_custom entry and puts it into /boot/grub/grub.cfg.

      But, when I reboot, there are only the Kubuntu menu items -- the contents of
      ### BEGIN /etc/grub.d/40_custom ###
      # This file is an example on how to add custom entries
      title Debian sidux GNU/Linux on hd2,1
      configfile (hd2,1)/boot/grub/menu.lst
      ### END /etc/grub.d/40_custom ###
      do not show on the boot menu on screen.

      Comment


        #4
        Re: Who has mastered Grub2?

        Hmm... can you post you whole 40_custom file?

        Edit:
        Have you tried editing:
        30_otheros?
        HP Pavilion dv6 core i7 (Main)
        4 GB Ram
        Kubuntu 18.10

        Comment


          #5
          Re: Who has mastered Grub2?

          Sure. BTW, to work around the problem (I think there's a bug in Grub 2), I have installed legacy Grub on the MBR, from my other Debian system, and am using it to boot both OS's. It works fine -- I'm writing this from Karmic. But it would be great to get Grub 2 to work right.

          OK, I posted the grub.cfg file above, so here is 40_custom, as last edited:
          #!/bin/sh
          exec tail -n +3 $0
          # This file is an example on how to add custom entries
          title Debian sidux GNU/Linux on hd2,1
          configfile (hd2,1)/boot/grub/menu.lst
          I previously tried it like this:
          #!/bin/sh
          exec tail -n +3 $0
          title Debian sidux GNU/Linux on hd2,1
          configfile (hd2,1)/boot/grub/menu.lst
          # This file is an example on how to add custom entries
          and I also tried it like this:

          #!/bin/sh
          exec tail -n +3 $0
          # This file is an example on how to add custom entries
          title Debian GNU/Linux, kernel 2.6.30-4.slh.1-sidux-amd64
          root (hd2,0)
          kernel /boot/vmlinuz-2.6.30-4.slh.1-sidux-amd64 root=/dev/sdc1 ro quiet vga=791
          initrd /boot/initrd.img-2.6.30-4.slh.1-sidux-amd64
          As I said, the entry in 40_custom is being picked up correctly in grub.cfg when I run
          Code:
          sudo update-grub2
          But, the on screen menu that is presented upon boot has no item for the second OS.

          I took a look at the 30_os-prober file, and thought about fiddling with it, but there's nothing in the reference that indicates that would be a good idea. It appears to be designed to go find the other OS and bring in the boot entry, but obviously it's not doing that here.

          I have the impression that it stops "reading" the grub.cfg file at this line:

          ### END /etc/grub.d/20_memtest86+ ###

          for some reason.

          Comment


            #6
            Re: Who has mastered Grub2?

            From comments/blogs I see, Grub 2 is not ready yet for "us." That might be an understatement. At this point, with what little documentation there is, the only thing one can do is experiment, trial and error, then draw conclusions (about the Grub 2 software). Maybe not best or wise, just yet, maybe even dangerous/erroneous. We need some official docs that point the way in terms of design and basic principles and caveats. As scanty as the GRUB 0.97 doc was, look how much mileage we all got out of it. I could never see any point in Grub 0.97 GUI's. However, from what little I've seen so far, it would seem useful--necessary in some cases? (I don't really know yet)--for folks to produce good GUI's for Grub 2. I experimented a long time ago with Grub 2 and came to the same dead-ends that other writers have, being able to take things only so far. I haven't had time to try Grub 2 again lately (work-work in a recession comes first), but it is high on my to-do list, along with replacing the kitchen faucet which has leaked for 3 months (and for which the new faucet is sitting right here in my office for two months ).
            => Time for some official Grub 2 documentation, I would think--some basic detailed guidance.
            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #7
              Re: Who has mastered Grub2?

              Thanks Mike.

              Here is the most work I have seen with the new Grub 2:

              http://ubuntuforums.org/showpost.php...58&postcount=6

              If I had a spare computer, I would try some of those experiments. It probably can be made to behave, if one only figures out the secret recipe. :P

              Comment


                #8
                Re: Who has mastered Grub2?

                Well, I managed to build a spare PC a few months back, DG33FB/E8400/4 GB/320 GB in a Lian Li, but .... there it sits, with sidux (previous) & 8.04.3 (extra copy) loaded, un-used. I had built it with Grub 2/Kubuntu 9.xx in mind. But not enough time yet.
                Yeah, experimenting might point the way somewhat in some ways, better than nothing, for sure.

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

                Comment


                  #9
                  Re: Who has mastered Grub2?

                  I have not installed Karmic. Is one given an option of using Grub or Grub2 during the install? If no option is avaiable, should one who is not ready to experiment just not install grub at all and simply modify the Grub menu.lst on your existing distribution which is remaining as the primary until Karmic final release?

                  Comment


                    #10
                    Re: Who has mastered Grub2?

                    I also have no experience with Karmic.
                    However, if you are given the option to install Grub or Grub 2, safe choices would be:
                    > Install Grub ONLY to the Karmic partition (the boot sector of the Karmic partition), and chainload that Grub using your existing Grub;
                    > Install Grub 2 ONLY to the Karmic partition (the boot sector of the Karmic partition), and chainload that Grub 2 using your existing Grub;

                    Next safest choice (not as safe as the two choices above):
                    > Install Grub to the MBR (of hd0--the first BIOS boot drive), replacing your existing Grub;

                    Least safe choice:
                    > Install Grub 2 to the MBR (of hd0--the first BIOS boot drive), replacing your existing Grub;
                    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: Who has mastered Grub2?

                      The problem with the one CD is that you can't cram in many options. The default installation is more or less same as the largest number of packages in one CD. And now the GRUB 2 is the default.

                      With the Alternate Kubuntu CD (alpha-3) the options are the GRUB and the LILO. I didn't check if there is a sub-option to choose the GRUB Legacy.

                      Here the GRUB 2 if working as is the GRUB Legacy. There is a small "papercut": if i want to use the GRUB 2 i need to go to the bios settings and change the "First Boot Device" from the "HDD-0" to the "SCSI".
                      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


                        #12
                        Re: Who has mastered Grub2?

                        Originally posted by Detonate

                        Is one given an option of using Grub or Grub2 during the install? If no option is available, should one who is not ready to experiment just not install grub at all and simply modify the Grub menu.lst on your existing distribution which is remaining as the primary until Karmic final release?
                        No option, Detonate -- at least not on the daily build Live CD.

                        And, what happened to me was, it did not pick up the other OS. So, when I rebooted I had Kubuntu Karmic and nothing else. And, as you can see from the thread above, I putzed around attempting to configure it and struck out. So, my advice would be, if you want to install only Karmic as a single OS on a computer, it seems to work fine. But if you want to install it alongside an existing OS, then you'd better use the Alternate Install CD and install Grub to the partition root, and then edit your legacy boot menu to add Karmic.

                        Comment


                          #13
                          Re: Who has mastered Grub2?

                          Yes, I always use the alternate CD for my installs, so I think I can install without messing up my current grub and just chainload Karmic.

                          Comment


                            #14
                            Re: Who has mastered Grub2?

                            In today's updates, a grub2 update came down and I saw that grub.cfg was re-written during the update. Don't know what it means ...

                            Comment


                              #15
                              Re: Who has mastered Grub2?

                              Issue:
                              Dual boot, TWO hard drives, GRUB 2 (through & including 1.97 beta 4) => Very slow boot (with "GRUB Loading" message frozen for 60 seconds while the hard drive(s) spin), THEN it continues OK.

                              Q:
                              I got the impression this was a known bug, but am unable to locate anything about it.
                              I'll probably feel stupid for asking, but anyone else also experience this,
                              AND
                              does anyone have any info/links on the "possible bug"?
                              Thanks.
                              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