0

So basically I want a portable bootloader on a usb drive that can be used to boot any of the computers/distros I have preconfigured to work with this grub install. I am testing on ubuntu to figure out the ins and outs, and because I have two separate installs of ubuntu with bios and efi installs.

I am trying to do this myself will using techniques that others have developed. This is my partition table as read out by gdisk.

Number  Start (sector)    End (sector)  Size       Code  Name
   1           10240          624639   300.0 MiB   EF00  EFI System
   2          624640          626687   1024.0 KiB  EF02  BIOS boot partition
   3          626688         9015295   4.0 GiB     8300  Linux filesystem

The table is a gpt/protected mbr, the efi partition is fat32, and the 3rd partition where grub is installed is ext4.

The command I used to install grub was

sudo grub-install --efi-directory=/mnt/efi --boot-directory=/mnt --removable

The reason I have only done a efi install so far is that I have read in a few seperate places that grub efi can support bios systems with this partition configuration.

Given the context above my question relates to a strange problem I am having. When i try to test the drive on my bios based system, the bios won't post if the drive is installed. If I put the drive in any other port, same issue. If i blow partition table away with dd, the bios successfully posts. If i recreate the partition table without a grub install the issue returns.

I have not idea what is going on with this particular partition table structure. Does anyone know what's happening here?

F.Y.I. This issue does not persist in my efi/uefi systems.

1
  • There are two PC versions of grub, grub-pc for BIOS boot and grub-efi-amd64 for UEFI boot on 64 bit systems. Also versions of grub for other systems as well. The can separately be installed and may work for a bit. But only one stays installed an when it updates may create issues for other version. A few old BIOS or external drives may not like gpt, but most will boot in BIOS mode from gpt. help.ubuntu.com/community/Installation/UEFI-and-BIOS/… Note that Ubuntu's live installer is UEFI boot with grub and BIOS boot with syslinux. – oldfred Jan 12 '20 at 14:59
0

So I spent about an hour testing everything I could of think of and seem to have solved the issue.

  • When i try to test the drive on my bios based system, the bios won't post if the drive is installed.

    • If I put the drive in any other port, same issue.
    • If I blow partition table away with dd, the bios successfully posts.
    • If I recreate the partition table without a grub install the issue returns.
    • If I use this drive on any uefi system, this issue doesn't exist.
    • If I remove the unusual offset of the first partition the issue persists.
    • If I move the efi partition behind the bios_grub, and main grub partition, the issue persists.
    • If I make the whole drive a single partition with a efi attribute flag the issue persists.
    • If I make the whole drive a single partition with a BIOS_grub attribute flag the issue persists.
    • If I test the drive with a single blank partition without any flags, the issue persists.
    • If I do any of the previous tests of 2 other drives from different manufacturers the issue persists.
    • If I create hybrid mbr by converting the boot partitions from gpt to hybrid mbr after creation, this solved the issue.

    Googled my issue with hybrid mbr as a search criteria. I found this article of someone doing what I attempted to do. https://www.slivermetal.org/2016/09/18/how-to-create-an-hybrid-uefi-gpt-bios-gptmbr-boot-usb-disk/

I hope this helps others trying to do weird stuff with their bootloaders.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.