Announcement

Collapse
No announcement yet.

Chaining GRUB to another partition

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

    [SOLVED] Chaining GRUB to another partition

    I currently boot from a kubuntu system on /dev/sda1 (hd0,1). I have a version of the system I am testing on (hd0,2). What I want to do is test the boot system without having to install it to the MBR. As far as I can tell, the following should work if entered into the grub menu editor when booting (hd0,1):

    insmod chain
    insmod ext2
    set root='(hd0,2)'
    chainloader +1

    but it doesn't work. I get a message about "invalid signature". So I tried the --force option with the chainloader command, and it just freezes.

    (hd0,1) is precise
    (hd0,2) is quantal

    both are ext4 formatted. I can of course boot quantal from precise's boot menu, but that is not the object here -- I want to test quantal's boot menu without changing the MBR in case it doesn't work.
    We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

    #2
    See GNU GRUB Manual 2.00~rc1, 4.1.2 Chain-loading an OS
    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


      #3
      That's where I got the info I tried, and it doesn't work. Produces the errors mentioned.
      Unless I missed something...
      We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

      Comment


        #4
        Firstly, a terminology comment: Unless you are chainloading to sda1, you're are booting to the MBR on sda (note absence of 1 ). I only point this out because this post will get rapidly confusing if we're all not using the same terminology. A boot record residing on sda1 would be a PBR (partition boot record). You are attempting to chainload from the MBR on sda to the PBR on sda2: I will assume this is the case.

        A change occured in 1.98. While grub still uses "chainload" for the windows bootloader, it does not for another instance of itself. It now uses the keyword "multiboot" rather than chainload.

        Try this:

        Code:
        insmod chain
        insmod ext2
        set root='(hd0,2)'
        multiboot /boot/grub/core.img
        You can also use:

        Code:
        search --fs-uuid --set f5d9c7fc-23eb-4473-abb6-5f11fc6c3c1b
        in place of the "set root" line - using your own uuid of course.

        Please Read Me

        Comment


          #5
          Thanks, finally got it to work. Seems like GRUB commands never work quite the way you expect them to.

          For clarification, the system the MBR points to is on /dev/sda1 (hd0,1), and the system I am trying to chain to is on /dev/sda2 (hd0,2), and the label (as revealed by blkid) of the system I am chaining to is testing .

          This is what worked:

          set root='(hd0,2)'
          search --set root --label testing --hint hd0,msdos2
          configfile /boot/grub/grub.cfg

          Good thing I was able to do this without changing the MBR, as it is in fact messed up. Only shows the menu items in my custom file, and the boot options for (hd0,1), but nothing else. At least I can test it now.

          Thanks for the info.
          We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

          Comment


            #6
            A couple of points:
            1) The search line sets the root variable, so the set root= only applies if the search fails.
            2) The help-grub@gnu.org mailing list is friendly and responsive. See http://lists.gnu.org/mailman/listinfo/help-grub

            Regards, John
            Regards, John Little

            Comment

            Working...
            X