Announcement

Collapse
No announcement yet.

HOW TO: GRUB Methods - Toolkit

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

    #31
    Re: HOW TO: GRUB Methods - Toolkit

    They both do the same thing. I just wondered if I was missing something, and one method was better than the other. I have already played with it, and it works both ways. I'm using the Kubuntu Grub now, as the primary with the configfile entry booting mandriva.

    Comment


      #32
      Re: HOW TO: GRUB Methods - Toolkit

      The chainloader method does require that GRUB be installed to the boot sector of the Kubuntu partition (which is not a bad idea anyway, even if you don't use it immediately).
      The configfile method requires nothing special--it's ready to go. What it says, of course, is "show me the menu.lst located at (hdx,y)/boot/grub," (then you will make your choice). So then you see two menu.lst's. Not a bad idea setting the default the way you want it on the 2nd menu.lst and setting its timeout to 2 seconds (gives you time to intervene,e.g., with the "c" key, should you want to).

      So, to answer your question, you are not missing anything--I think you got it about as well as I understand it. Two ways to do it, one about as good as the other.

      However, should you reinstall Kubuntu to that same partition, configfile is safer (=> failsafe). When you re-install Kubuntu to the same partition (or install a new Kubuntu there), the installation of GRUB in the first sector may not work. I haven't tested this. The old GRUB stage_1 will still be there in the first 512 bytes of the Kubuntu partition, but will it "connect" to stage_2 in the Kubuntu root filesystem (that gives you your menu.lst)? I doubt that it will work. You would then have to reinstall GRUB to (hdx,y) using the new Kubuntu installation (using root -- setup -- quit, as usual).

      I like configfile, and that's what I use. It always works. And I use a separate GRUB partition (that's also posted here in the Replies under this how-to). The GRUB partition contains ONLY the GRUB files and the menu.lst -- and all OSs are booted by configfile (except XP, which is booted by chainloader).

      Also, as an academic note, if you scroll down through this how-to, there's a post about chainloading from GRUB to LILO (LILO is an option upon installation using the Alternate install CD where you would specify to install LILO to the boot sector).
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #33
        Re: HOW TO: GRUB Methods - Toolkit

        I read the whole thread!! I have not used LILO in many, many, years.

        Comment


          #34
          Re: HOW TO: GRUB Methods - Toolkit

          Major revision/re-write of the original GRUB Toolkit.

          HOW TO: GRUB Methods
          Toolkit for Installation, Rescue, Repair - Fixing Common GRUB problems

          Includes the first post—the original post--and Reply #1

          It now includes 12,000 words, about 3x the original.
          (If copied to OOo Writer, in 12-pt type, 3/4-inch margins, it's about 35 pages.)

          The full Table of Contents appears in the original post.

          It is now a fairly comprehensive, intermediate-level GRUB tutorial,
          and includes many useful, special methods/techniques/tips.

          It includes RECOMMENDED methods for setting up a dual boot of two Kubuntu/Linux OSs and for XP and Kubuntu/Linux, and addresses fixing most booting problems.

          Several other tutorial posts in this thread have been deleted, as their topics have been re-written and included in the first two posts (the OP and Reply #1).


          TABLE OF CONTENTS—abbreviated (see OP for complete TOC)

          GRUB ERRORS: See Reply #23
          REFERENCES: Listed at the end of this Table of Contents

          SECTION 1
          Basics
          --- Introduction: What is GRUB? Two key components that make GRUB work.
          --- Abbreviations, Notation, GRUB devices (hdx,y), Linux devices sdxn, UUIDs
          --- Getting information about drives, GRUB files, menu.lst, fstab, UUIDs, version #'s
          --- IMPORTANT: Exploring your hard drive(s)
          fdisk, geometry, Tab-completion

          SECTION 2
          GRUB facts
          How GRUB works, MBR, GRUB files, image directory, “first BIOS boot drive”

          SECTION 3
          Re-installing GRUB: the cure for many problems.
          --- Re-installing/installing GRUB

          SECTION 4
          Menu.lst (everything you need for editing)

          SECTION 5
          Dual-booting
          Installing two or more Linux operating systems RECOMMENDED method

          SECTION 6
          Windows topics
          --- Vista, dual-booting with XP and/or Kubuntu/Linux, see this definitive guide:
          http://apcmag.com/dualboot
          --- XP
          Installing XP & Kubuntu: How to set up dual booting
          Re-installed XP and now can't boot Kubuntu
          When XP is on a non-first hard drive
          --- Special Situations
          -- How to avoid installing GRUB to the MBR of your Windows XP drive
          -- Two drives, a Windows drive and a Kubuntu drive, GRUB is in the Windows MBR,
          but sometimes you must remove the Kubuntu drive
          and Windows won’t boot when you do.

          - - - - - - - - - - Reply #1 Topics Start Here- - - - - - - - - -

          The following topics are located in the next post -- Reply#1

          SECTION 7 (see Reply #1)
          Getting a copy of GRUB files: 4 ways to get GRUB files

          SECTION 8 (see Reply #1)
          Rescue booting or by menu.lst
          GRUB booting methods => booting in an emergency at grub>
          --- Configfile -- Booting
          --- Chainloading
          --- Booting directly using kernel & initrd; Tab-completion
          --- Boot into Kubuntu using the edit function “e” on a broken boot menu

          SECTION 9 (see Reply#1)
          Making and using a separate GRUB partition

          SECTION 10 (see Reply #1)
          Rescuing Your System, Emergencies, Fixing Boot problems

          Special Topic:
          Use GRUB to Chainload LILO
          See Reply #17 of this thread

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

          Comment


            #35
            Quick Course -- Re: HOW TO: GRUB Methods - Toolkit

            GRUB Quick Course – solves 80-90+% of GRUB problems

            when you have a problem ... the following is usually all you need to know

            GRUB survival

            > Check menu.lst as root: spelling, syntax, then device references (hdx,y) and UUIDs.
            > Reinstall GRUB from the controlling OS GRUB files (in (hdx,y)) to the MBR of the first BIOS boot drive: sudo grub to get the GRUB prompt, then 3 quick commands: root (hdx,y), setup (hd0), quit.
            > If it goes not to (hd0) but to an external drive or flash drive or to the MBR of another internal drive, same drill, different step: root (hdx,y), setup (hd1), quit (or (setup (hd2), etc.).
            > If you ever need to know the correct GRUB devices (hdx,y) for partitions or (hdx) for drives, simply get a grub prompt (sudo grub from an OS or from a Live Linux CD) and do a tab-completion with the geometry command: grub>geometry (hd<press the TAB key now>; => explore each drive with grub>geometry (hd0), grub>geometry (hd1), etc.
            > If you put XP on a non-first HD, shame on ya, then use the map dance in its menu.lst;
            > If Vista is involved, go here and stay there:
            Vista *** The definitive dual-booting guide: Linux, Vista and XP step-by-step
            http://apcmag.com/dualboot


            => No need really for a 35-page manual


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

            Comment


              #36
              Re: HOW TO: GRUB Methods - Toolkit

              I need some help and trying to understand and read through just the OP is starting to hurt my head. I'm pretty new to dual/triple booting with GRUB and Linux so I think I've gotten in over my head.

              Here's my setup:
              1 HDD (150GB)
              Primary Partition 1 - WinXP
              Primary Partition 2 - Win7
              Extended Partition - Linux
              Logical Drive 3 - /home
              Logical Drive 4 - /
              Logical Drive 5 - /swap

              WinXP and Win7 were installed first. EasyBCD was used to set up the bootloader to boot WinXP by default. When I installed Linux, it installed GRUB (which is fine) but the options are all wierd.

              My default is now Kubuntu, and then there's another 3 different options for Kubuntu, then "Other Windows Vista/Longhorn installation". If I select "Other Windows" it loads the EasyBCD bootloader which is still set to WinXP by default.

              How do I edit GRUB to remove the EasyBCD bootloader and put a simple 3 option WinXP, Win7, Kubuntu GRUB menu?

              Eventually I want to virtualize WinXP in Kubuntu so then I'll change the default from WinXP to Kubuntu. Yeah, for never having done this before I feel like I bit off more than I should have.

              Comment


                #37
                Re: HOW TO: GRUB Methods - Toolkit

                My best guess:

                You say GRUB is installed to the MBR of that drive and that it brings up the boot menu (/boot/grub/menu.lst) in Kubuntu. Good.

                First thing I'd try is to simply edit that menu.lst (as root--see the how-to) to include two entries for XP & 7, trying to boot each by a direct chainload:

                title XP
                root (hd0,0)
                chainloader +1

                title 7
                root (hd0,1)
                chainloader +1


                Now, in principle, that *should* do it. When you select 7, though, you MAY get another boot menu coming from 7 offering you XP, I'm not sure. When 7 first came out, there was something "strange" about how when called, it would also then give you the option of loading XP; that is, 7 would try to take over the Windows side of the boot management.

                I don't know. Don't use 7 or Vista (I have an old XP installed in dual boot and I never use it).
                Here:
                Vista *** The definitive dual-booting guide: Linux, Vista, Windows 7, and XP step-by-step
                http://apcmag.com/dualboot
                That is the current bible on the new Windows systems.
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #38
                  Re: HOW TO: GRUB Methods - Toolkit

                  Ok, here's what I've got so far:

                  sudo fdisk -l
                  Code:
                   Device Boot   Start    End   Blocks   Id System
                  /dev/sda1 *     1     11808  94847728+ 7 HPFS/NTFS
                  /dev/sda2     11809   15632  30716280  7 HPFS/NTFS
                  /dev/sda3     15633   19457  30724312+ 5 Extended
                  /dev/sda5     15633   16269  5116671 83 Linux
                  /dev/sda6     16270   18947  21511003+ 83 Linux
                  /dev/sda7     18948   19457  4096543+ 82 Linux swap / Solaris
                  /boot/grub/menu.lst (original)
                  Code:
                  title        Ubuntu 8.10, kernel 2.6.27-7-generic
                  uuid        2ac9c8f6-707b-4126-828c-b6d60bcff44c
                  kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=2ac9c8f6-707b-4126-828c-b6d60bcff44c ro quiet splash
                  initrd        /boot/initrd.img-2.6.27-7-generic
                  quiet
                  
                  title        Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
                  uuid        2ac9c8f6-707b-4126-828c-b6d60bcff44c
                  kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=2ac9c8f6-707b-4126-828c-b6d60bcff44c ro single
                  initrd        /boot/initrd.img-2.6.27-7-generic
                  
                  title        Ubuntu 8.10, memtest86+
                  uuid        2ac9c8f6-707b-4126-828c-b6d60bcff44c
                  kernel        /boot/memtest86+.bin
                  quiet
                  
                  ### END DEBIAN AUTOMAGIC KERNELS LIST
                  
                  # This is a divider, added to separate the menu items below from the Debian
                  # ones.
                  title        Other operating systems:
                  root
                  
                  
                  # This entry automatically added by the Debian installer for a non-linux OS
                  # on /dev/sda1
                  title        Windows Vista/Longhorn (loader)
                  root        (hd0,0)
                  savedefault
                  makeactive
                  chainloader    +1
                  /boot/grub/menu.lst (modified)
                  Code:
                  title        Ubuntu 8.10
                  uuid        2ac9c8f6-707b-4126-828c-b6d60bcff44c
                  kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=2ac9c8f6-707b-4126-828c-b6d60bcff44c ro quiet splash
                  initrd        /boot/initrd.img-2.6.27-7-generic
                  quiet
                  
                  
                  title        Windows XP
                  root        (hd0,0)
                  makeactive
                  chainloader    +1
                  
                  title        Windows 7
                  root        (hd0,1)
                  makeactive
                  chainloader    +1
                  
                  title        Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
                  uuid        2ac9c8f6-707b-4126-828c-b6d60bcff44c
                  kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=2ac9c8f6-707b-4126-828c-b6d60bcff44c ro single
                  initrd        /boot/initrd.img-2.6.27-7-generic
                  
                  title        Ubuntu 8.10, memtest86+
                  uuid        2ac9c8f6-707b-4126-828c-b6d60bcff44c
                  kernel        /boot/memtest86+.bin
                  quiet
                  
                  ### END DEBIAN AUTOMAGIC KERNELS LIST
                  
                  # This is a divider, added to separate the menu items below from the Debian
                  # ones.
                  # title        Other operating systems:
                  # root
                  
                  
                  # This entry automatically added by the Debian installer for a non-linux OS
                  # on /dev/sda1
                  # title        Windows Vista/Longhorn (loader)
                  # root        (hd0,0)
                  # savedefault
                  # makeactive
                  # chainloader    +1
                  Fortunately, I can access all three operating systems just fine, so long as I want to jump through some hoops. I want to fix it up though so I don't have to.

                  When I choose the WinXP option (hd0,0) it loads the original Windows 7 bootloader (similar to Vista's) which gives me the option of XP or Win7. I can load either from this menu just fine like I used to before I installed Kubuntu.

                  If I choose the Win7 option (hd0,1) it crashes out that there's no boot information (will have to try it again for the actual verbage) and I have to restart.

                  I'm assuming that GRUB installed itself in my Linux partition, and left my Windows bootloader where it was rather than overwriting it. I'm just not sure how to go about fixing that though. I looked at the "dual booting Vista and Linux (Vista installed first) site and it basically has my current situation as the "solution".

                  Comment


                    #39
                    Re: HOW TO: GRUB Methods - Toolkit

                    title Windows XP
                    root (hd0,0)
                    makeactive
                    chainloader +1

                    title Windows 7
                    root (hd0,1)
                    makeactive
                    chainloader +1

                    Correct, except they should be placed after these lines:
                    ### END DEBIAN AUTOMAGIC KERNELS LIST

                    # This is a divider, added to separate the menu items below from the Debian
                    # ones.
                    title Other operating systems:
                    root

                    NOW place those two boot stanzas.

                    ------------------------
                    "I'm assuming that GRUB installed itself in my Linux partition, and left my Windows bootloader where it was rather than overwriting it."

                    I don't think so. That is, it looks like GRUB got installed into the MBR of that drive and thus DID overwrite the Windows bootloader (that was previously installed in the MBR of that drive). (GRUB may or may not also be in the boot sector of the Kubuntu partition--it probably is not installed there.)

                    So, your setup looks correct. GRUB looks correct. GRUB is working as it should. This is a Windows issue. Now, you have to deal with that thing that 7 does wrt the Windows bootloader(s).

                    GRUB has done its thing: it passes control (through chainloading) to the Windows XP bootloader (which is in the boot sector (= sector 1) of the XP partition). GRUB is working OK.

                    Now, as to "how to" fix that thing that 7 seems to do, I don't know. Yours is not the first report of such, maybe a google will come up with some ideas how to do surgery on the Windows bootloaders. Your question is, "How does one boot 7 directly from the GRUB boot menu?" I thought the chainloader should work, but it didn't. Reason: It failed to boot 7 directly because--apparently--7 did not install its Windows bootloader to the boot sector of the 7 partition (either that, or that is not how 7 is setup to do the bootloading; it seems that 7 passes control first to XP).

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

                    Comment


                      #40
                      Re: HOW TO: GRUB Methods - Toolkit

                      Thanks Q! This little bit helped 100%!

                      XP on a non-first hard drive: (hdx,y), x > 1
                      Suppose Kubuntu is on your first BIOS boot drive hd0, and GRUB (from Kubuntu) is installed to the MBR (hd0); thus, your PC boots from hd0 using GRUB.

                      Later, you wish to install Windows on a second hard drive, (hd1), and you wish to set things up so GRUB controls the booting through its boot menu.
                      Example
                      To give a specific example, let’s say Windows XP goes into (hd1, 0) (the first partition of your second hard drive). (This method also works when Windows is on any non-first hard drive, (hdx,y), where x > 1.)
                      To boot XP from your boot menu, edit /boot/grub/menu.lst (in Kubuntu) to include the following boot entry for XP:
                      title Microsoft Windows XP
                      map (hd0) (hd1) # Map hd1 to hd0
                      map (hd1) (hd0)
                      rootnoverify (hd1,0) # rootnoverify ensures no attempt is made to mount Windows
                      chainloader +1

                      Comment


                        #41
                        Re: HOW TO: GRUB Methods - Toolkit

                        Hi MoonRise -- Glad it helped!
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #42
                          I'll be darned. I thought this old GRUB Legacy how-to got zilched on our transition to this new forum, several years ago. This is kinda fun poking around here to see what's what!
                          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