Announcement

Collapse
No announcement yet.

Grub

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

    Grub

    Hello,
    I have a grub question regarding the install of Kubuntu. I had some partition space for one more distro so I installed Kubuntu. The install turned out okay but not what I intended. I don't know if I missed something but the Kubuntu installer wrote (its) grub to the MBR which screwed up my previous grub which was wrote to the MBR but from my Debian Lenny install. My issue is that I couldn't find any option for dictating where grub would be installed during the Kubuntu install.

    Is this an issue with Kubuntu or did I just miss it somehow? I don't like how it appeared that the default would be to write to the MBR. That is too Windowsy, deciding what to do. Unless of course, I made an error in my install. I knew my partition and already had a swap so all that is fine. I was careful with which partition to choose etc. etc. But, how come it was not more intuitive regarding where grub is installed?

    I am just learning grub and multi-booting so now I have tons of reading to do. I guess it doesn't matter much as it's not a big deal but if I really wanted my other distro to handle the main booting (that is, for grub from its install to write to MBR), I wouldn't be too pleased. Actually, the entire Kubuntu install was an experiment in which I was going to edit the /boot/grub/menu.lst in my Debian partition to chain load Kubuntu. However, now, it's the other way around, possibly but not my intention.

    Anyway, I hope there is a logical explanation and I hope it's not the default install with no options for changing where grub installs.

    Thanks for reading.

    P.S. I had Kubuntu last installed when it was Gutsy. Not that it matters....

    #2
    Re: Grub

    Using the regular Live Kubuntu CD Desktop installer:
    Step 4: manual partitioning method
    Step 6: click the Advanced button at lower right; there specify where to install GRUB

    You can easily fix your setup and restore booting to the previous GRUB install by “reinstalling” GRUB to the MBR using the GRUB files from Debian Lenny. This uses the three commands in GRUB:
    root (hdx,y)
    setup (hdz)
    quit

    (hdx,y) = Debian Lenny
    (hdz) = the MBR of hard drive z where you want GRUB installed (from Lenny) which usually equals (hd0) (i.e., z = 0).
    And then in Lenny's menu.lst include a boot entry for Kubuntu (which you will copy from /boot/grub/menu.lst in Kubuntu and paste into Lenny's menu.lst).


    How To GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0

    Bigpond, home: http://users.bigpond.net.au/hermanzone/
    (click to the GRUB page)


    ************* EDIT added:
    > you can do this (reinstall GRUB) either from Kubuntu or from a Live CD (or from Lenny if you can get into it say manually or by using Super Grub Disk);

    > use the geometry command to see how BIOS & GRUB see your hard drives:
    grub> geometry (hd0)
    grub > geometry (hd1)
    etc
    or Tab completion works:
    grub> geometry (hd<Press the TAB key now>
    (don't type the < and > signs, of course)

    It's all in my how-to as well as Herman's @ bigpond.
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: Grub

      I've been reading on grub so what you posted makes good sense (I hope - when I go to try it!). Thanks for the great writeup!

      I don't know how but somehow I missed the spot in 'step 6' where I could specify. 'Advanced' button at lower right, huh? Hmmmm... Okay, good to know for next time. Thanks again.

      Comment


        #4
        Re: Grub

        You're not alone -- lots of folks miss Step 6 Advanced. It's not well publicized for some reason. Only paranoid GRUB types seek it out ...

        (see my EDIT added above, too)
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: Grub

          ... and if you get stuck or have any questions, please freely post back here; I may not be around, but we have a many, many folks who, like you & me, have been down this GRUB road and will be glad to help
          (didn't mean to imply you had to read through all that stuff and get it straight right off the bat)
          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: Grub

            I hope you visit, then! Those were excellent posts. They should help not just me but any others who would like excellent posts and write ups on Grub and various ways of using it!

            Comment


              #7
              Re: Grub

              When you have time, check out Herman's website, which is now a Linux classic and standard:

              Bigpond, home: http://users.bigpond.net.au/hermanzone/

              Of course, his GRUB page is a place to start, but you'll find a dozen other neat topics as well (e.g., filesystems). He references psychocats a lot; another standard reference is tuxfiles (google those names). I got my start two years ago using Herman's site as one of the main starting points. Herman is an Ubuntu guy, but that makes no difference in using his how-to's: they apply straightaway to Kubuntu and many/most other distros.

              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: Grub

                I set up my dedicated/separate partition but I had major problems.

                Each distro (partition) would not boot up and I would get:

                Error 13: Invalid or unsupported executable format

                I managed to repair the other distros but I can't get Kubuntu to boot up as I keep getting that error.

                I checked the /boot/grub directory and all the info seems to be there. I believe the menu.lst in the separate grub partition is pointing to the Ubuntu partition. So, what could be the problem? I have Kubuntu setup to chain load like the others but it's the only one that's not booting up now.

                Any ideas?

                Comment


                  #9
                  Re: Grub

                  Let's see,

                  You set up a separate partition to be used as the “separate GRUB partition.” And so it contains those GRUB files (the stages and menu.lst, which you probably copied as root from your Kubuntu partition /boot/grub)). Let's call that GRUB partition (hdx,y). So then you re-installed GRUB to the MBR of the first-boot drive (hd0) using the GRUB files in (hdx,y): root (hdx,y) then setup (hd0) then quit.

                  OK. Now Kubuntu won't load by chainloading.
                  The reason is that you did not also set up GRUB in the boot sector (= sector 1) of the Kubuntu partition. Since you are chainloading from the menu.lst you need to chainload to some bootloader; that is, you need to pass control off to a bootloader in the Kubuntu partition that will, in turn, boot Kubuntu. But you probably do not have a bootloader installed to the Kubuntu partition.
                  Here's how to install GRUB to the boot sector of the Kubuntu partition:
                  Let's say Kubuntu is in the partition (hdp,q).
                  Then
                  grub> root (hdp,q)
                  grub> setup (hdp,q)
                  grub> quit
                  That should fix it.
                  (By the way, you could also install LILO to the Kubuntu partition and chainload from GRUB to LILO, and LILO would then boot Kubuntu; there's a post in the how-to thread on that, too.)


                  However, there's another way to boot Kubuntu, not by chainloading but by configfile, which I like.

                  It's in Reply #10 of the how-to
                  (the example assumes Kubuntu is in (hd1,4) and the menu.lst is in sdb12, which would be the GRUB partition in your case):

                  - - Using configfile to simplify things.
                  Use configfile in the menu.lst of the GRUB partition for Linux operating systems. That way, you won’t have to manually update the kernel lines in the menu.lst of your GRUB partition each time there is a change/update in one of your OS kernels.
                  Example: Suppose you have an instance of Kubuntu on sdb5. To boot to it from the boot menu on sdb12, as root, access /boot/grub/menu.lst on sdb12 and include the following boot entry for Kubuntu on sdb5:
                  title Kubuntu on sdb5 = (hd1,4)
                  root (hd1,4)
                  configfile /boot/grub/menu.lst
                  When you select this from the sdb12 boot menu, GRUB will show you the boot menu from sdb5, from which you then select Kubuntu again (or any other OS listed on the sdb5 menu.lst). That is, you will see two boot menus. To make Kubuntu boot automatically and quickly from the second boot menu, edit, as root, /boot/grub/menu.lst on sdb5, to set the timeout to some small number of seconds (e.g., timeout = 2), and set the default = n to point at the Kubuntu on sdb5 (i.e, set n equal to the position of Kubuntu in the menu.lst, counting title lines starting at zero). See Reply #2 above on editing the menu.lst. (End of quote from Reply #10 of the how-to)


                  So, there you have it, either by chainloading or by configfile.




                  *******************
                  ******************* EDIT added:
                  Chainloading is in the How-to, Method #1 under the sub-heading
                  - - - How to: Manually boot into a Linux OS from a grub> prompt
                  Method #3 is configfile.
                  (There's a lot of stuff packed into that how-to and the posts that follow. It can be difficult to extract the info. Someday I should re-organize it or something.)



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

                  Comment


                    #10
                    Re: Grub

                    Originally posted by Qqmike
                    Let's see,

                    You set up a separate partition to be used as the “separate GRUB partition.” And so it contains those GRUB files (the stages and menu.lst, which you probably copied as root from your Kubuntu partition /boot/grub)). Let's call that GRUB partition (hdx,y). So then you re-installed GRUB to the MBR of the first-boot drive (hd0) using the GRUB files in (hdx,y): root (hdx,y) then setup (hd0) then quit.

                    OK. Now Kubuntu won't load by chainloading.
                    The reason is that you did not also set up GRUB in the boot sector (= sector 1) of the Kubuntu partition. Since you are chainloading from the menu.lst you need to chainload to some bootloader; that is, you need to pass control off to a bootloader in the Kubuntu partition that will, in turn, boot Kubuntu. But you probably do not have a bootloader installed to the Kubuntu partition.
                    Here's how to install GRUB to the boot sector of the Kubuntu partition:
                    Let's say Kubuntu is in the partition (hdp,q).
                    Then
                    grub> root (hdp,q)
                    grub> setup (hdp,q)
                    grub> quit
                    That should fix it.
                    Yep, that basically fixed it. I thought that I tried that previously and still received the grub 13 error. Very strange.

                    So 'p' = drive (#) and 'q' is partition (#) in grub speak (everything starting at '0')?

                    Anyway, I have a new (larger) HDD so I'm going to try to redo my system and configure with a dedicated/separate grub again.

                    What do you think of my steps?:
                    1) Using GParted - format HDD - 1st partition is NTFS for Windows XP (yeah, but I don't use it much anymore...honest! ;-)
                    2) 2nd partition for another NTFS partition
                    3) should I have a 3rd NTFS or primary partition?
                    4) Create Extended partition for logical drives - will install Linux OS's on these
                    5) create small partition for separate Grub partition - ext2 (okay? or does it matter? ext3?)
                    6) create linux-swap partition
                    7) create linux OS partition - ext3
                    8) Linux OS etc. etc.

                    So, the drive partition arrangement looks something like:
                    sda1 NTFS Windows
                    sda2 NTFS
                    sda3 Extended partition
                    sda5 Grub partition
                    sda6 Linux-swap
                    sda7 Linux OS - Kubuntu? ;-)
                    sda8 Linux OS
                    etc. etc.

                    What do you think?

                    My plan is to install a Linux OS (one with LiveCD) and then copy the Grub info (/boot/grub directory) over to the Grub partition and then enter in the chain loader info by editing the newly created (from a copy) menu.lst

                    Comments?

                    Comment


                      #11
                      Re: Grub

                      “So 'p' = drive (#) and 'q' is partition (#) in grub speak (everything starting at '0')? “

                      Yep.


                      Partitioning: I'd use ext3 for Kubuntu.
                      There's lots of posts here about partitioning philosophy.
                      A good how-to is:
                      Partitioning—how to, Rog131:
                      http://kubuntuforums.net/forums/inde...opic=3090704.0

                      Good idea to use GParted to do ALL partitioning before running any Linux installer.

                      You'd get lots of opinions about partitioning here!
                      For example, I'd put the swap as the first Logical partition sda5 because it will not change, so if you do any partition resizing among the Logicals, you won't have to mess with the swap (only sda6 and beyond are affected). Also, most folks use a separate /home partition (see the how-to or search the forum), at least for their “main” working distro. Do not try to share one /home among two or more distros, though (that's my opinion, but I'll bet some people here do so without problems). And so on.


                      "My plan is to install a Linux OS (one with LiveCD) and then copy the Grub info (/boot/grub directory) over to the Grub partition and then enter in the chain loader info by editing the newly created (from a copy) menu.lst"

                      --Yep, sounds good.
                      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