Announcement

Collapse
No announcement yet.

booting with grub to non-/dev/sda partition

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

    booting with grub to non-/dev/sda partition

    Hi there -

    short version: if I want to boot to partition /dev/sdc2 (GPT) from the main grub menu on /dev/sda (MBR, booted non-UEFI on UEFI mobo), do I need to do the whole "BIOS Boot Partition" thing and install grub to /dev/sdc, or is there a better/easier/simpler way?

    long version:

    Dual boot Win8 and 13.04 on /dev/sda, which is MBR.

    My mobo is UEFI, but it's booting to grub non-UEFI (long story). Because I installed kubuntu from a flash drive which was booted UEFI, the grub package installed was grub-efi rather than grub-pc. Booting things on /dev/sda is working fine.

    /dev/sdc is GPT and /dev/sdc2 is the location of an intended system rescue CD installation (and /dev/sdc3 will eventually be an alternative linux distro). Thus I want to be able to boot to that partition on startup from the grub screen.

    I followed the system rescue CD instructions at http://www.sysresccd.org/Sysresccd-m...Cd_on_harddisk (basically you just copy things from the mounted ISO image to the partition into a subdirectory)

    My /etc/grub.d/40_custom entry is:

    Code:
    menuentry "System Rescue CD 3.7.0" {
    set root=(hd2,2)
    linux /sysrcd/rescue64 subdir=sysrcd setkmap=us
    initrd /sysrcd/initram.igz
    }
    update-grub works fine for inserting that into the menu, but when I try to boot it from startup I get "no such partition" errors.

    I thought "oh, maybe i have to install grub to /dev/sdc for some reason". grub-install /dev/sdc fails with the error saying i need either "--target" or "--directory" specified.

    Based on some googling, it seems that running grub-efi binaries when you're booted non-EFI is possibly the cause of that error (unless they just meant when you're working with an MBR disk...), and the recommended solution is:

    Code:
    sudo apt-get install --reinstall grub-pc
    ...which I did. A different set of failures (same as the ones coming up below), so I did:

    Code:
    sudo apt-get install --reinstall grub-efi
    Then when I tried grub-install /dev/sdc I get:

    Code:
    /usr/sbin/grub-bios-setup: Not found.
    Maybe the reinstalls borked grub, so I made a symlink from /usr/sbin/grub-bios-setup to /usr/lib/i386-linux-gnu/grub-bios-setup (based on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705636 )

    Now when I try to grub-install (with grub-efi or grub-pc) to /dev/sdc I get:

    Code:
    $ sudo grub-install /dev/sdc
    /usr/sbin/grub-bios-setup: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
    /usr/sbin/grub-bios-setup: error: embedding is not possible, but this is required for cross-disk install.
    I've read some language to the effect that if I want grub to boot a GPT disk, I need a boot partition on that disk, so maybe that's the issue. Anyway, any help in getting this stuff sorted out is greatly appreciated. I don't know that i necessarily even want to "embed" on to sdc, I just want to be able to boot that partition.

    Thanks for any insight!
    Last edited by chconnor; Jun 16, 2013, 11:47 PM. Reason: typo

    #2
    grub-pc works only on BIOS PCs or UEFI PCs that have been booted into BIOS mode. grub-efi works only on UEFI PCs, but can handle either native mode or BIOS mode booting. GPT disks are supported by both grub-pc and grub-efi.

    Search the Ubuntu wiki for BootRepair. Download and and run -- it should help you sort through the situation.

    BTW, what you're trying to do is actually much easier when you run in UEFI mode and use rEFInd instead of GRUB. UEFI eliminates most of the reasons that anyone would need GRUB. rEFInd installs into the EFI boot partition. Every time the computer boots, rEFInd searches every partition for a boot loader and presents a list of what it finds. It's amazing.
    Last edited by SteveRiley; Jun 16, 2013, 10:18 PM.

    Comment


      #3
      Thanks - BootRepair didn't work -- gave the same error (not surprising, since it would have to do partitioning of the disk?)

      But i figured it out (at least one way) - I did in fact create an unformatted BIOS boot partition (http://en.wikipedia.org/wiki/BIOS_Boot_partition) at the end of sdc. Following the wikipedia instructions (!) I set the "bios_grub" flag. I made mine 10MB (recommended 1 MB, but whatevs). Then did sudo grub-install /dev/sdc and it went fine.

      I then had to add "insmod part_gpt" to the grub menu entry -- otherwise, i take it, grub can't see the GPT partitions at all (!!) which i confirmed via CLI. I also corrected a typo in my entry, and voila, good to go.

      Code:
      menuentry "System Rescue CD 3.7.0" {
      insmod part_gpt
      set root=(hd2,2)
      linux /sysrcd/rescue64 subdir=sysrcd setkmap=us
      initrd /sysrcd/initram.igz
      }
      I still don't understand why grub needs to be installed at all on sdc, but i'm at least up and running with this.

      And i must say that UEFI has been somewhat of a pain. :-)

      Comment


        #4
        Originally posted by chconnor View Post
        I still don't understand why grub needs to be installed at all on sdc, but i'm at least up and running with this.
        GRUB may be chainloading in your setup -- not sure, really.

        Originally posted by chconnor View Post
        And i must say that UEFI has been somewhat of a pain. :-)
        No, it's just new. Like all new things, it comes with a learning curve. Once you grok UEFI, you'll never want to return to BIOS and all its limitations.

        Comment

        Working...
        X