10

I have an AMI BIOS computer [Asus EB1501P] with a Seagate ST9250315AS 250GB HDD.

Is it possible to boot Linux from a GPT disk on such a BIOS system?

3
  • 2
    Theoretically, GPT should work with BIOS, but there are occasional incompatibilities. See rodsbooks.com/gdisk/bios.html.
    – fixer1234
    Jul 8 '18 at 0:23
  • @fixer1234 Thanks. Can you please convert your response to an answer ?
    – SebMa
    Jul 9 '18 at 9:29
  • @phuclv Thank you, can you please convert your comment to an answer ?
    – SebMa
    Jul 12 '18 at 12:03
10

The BIOS generally doesn't care anything about your hard drives1. It simply loads the MBR and transfer control to the boot loader in MBR. Therefore technically it'll be possible to boot a GPT drive in BIOS mode, because the GPT drive still has a protective MBR at the beginning. You just need a bootloader that supports GPT disks (such as Grub and many other Linux bootloaders)

However, here a small problem arises. On MBR drives the boot loaders often cheat a bit by storing a part of them in the next sectors called "MBR gap", "boot track", or "embedding area" which are often left empty by disk partitioning tools. On a GPT disk the sectors right after the MBR are GPT data structures, hence can't be used for that purpose and you need to create a small BIOS Boot Partition for Grub to store its data

On a BIOS/GPT configuration, a BIOS boot partition is required. GRUB embeds its core.img into this partition.

Note:

  • Before attempting this method keep in mind that not all systems will be able to support this partitioning scheme. Read more on GUID partition tables.
  • This additional partition is only needed on a GRUB, BIOS/GPT partitioning scheme. Previously, for a GRUB, BIOS/MBR partitioning scheme, GRUB used the Post-MBR gap for the embedding the core.img). GRUB for GPT, however, does not use the Post-GPT gap to conform to GPT specifications that require 1_megabyte/2048_sector disk boundaries.
  • For UEFI systems this extra partition is not required, since no embedding of boot sectors takes place in that case. However, UEFI systems still require an EFI system partition.

Create a mebibyte partition (+1M with fdisk or gdisk) on the disk with no file system and with partition type GUID 21686148-6449-6E6F-744E-656564454649.

  • Select partition type BIOS boot for fdisk.
  • Select partition type code ef02 for gdisk.
  • For parted set/activate the flag bios_grub on the partition.

GUID Partition Table (GPT) specific instructions

Grub also supports hard coding the sector that contains the next stage so it can boot without a post-MBR gap or BIOS boot partition, but that's fragile because you need to update Grub after every OS update. Therefore this isn't recommended

For more information you can read


Another way is to convert the GPT drive back to MBR if your HDD is not too big. In fact it's possible to have MBR disks above 2 TB, upto ~233 sectors (i.e. 4 TB and 16 TB for disks with 512-byte and 4096-byte sector respectively) with a big partition lasting from just before the half disk margin. There are multiple tools to do the conversion without loss of data like gdisk, MiniTool Partition Wizard, AOMEI Partition Assistant, EaseUS Partition Master... (I'm not affiliated with any of them).

Since your HDD is just 250 GB so it'll work fine in MBR. But using GPT is much safer because it has checksum and a backup table at the end, although it's a lot trickier if you dual boot Windows or some other OSes that are BIOS GPT unfriendly


1There are some buggy BIOSes that eagerly unnecessarily do things they aren't supposed to do like checking the MBR signature or the active boot flag and refuse to boot on such drives

5

Theoretically, GPT should work with BIOS. However, there are occasional incompatibilities. These are generally in the nature of bugs or idiosyncrasies of specific hardware, so the information tends to be reports of exceptions rather than what you find in documentation of BIOS and GPT.

All of the possibilities are too broad to cover here, but see, for example, https://www.rodsbooks.com/gdisk/bios.html, which also discusses some potential solutions if you experience problems. The options depend on whether you want to stick with BIOS or switch to EFI/UEFI if your motherboard supports it.

If you add your motherboard, computer, and hard drive models to the question, someone who has tried it on an equivalent system and sees your question may be able to describe their experience.

1
  • Hi, I added my hardware info. in EDIT 1.
    – SebMa
    Jul 9 '18 at 22:42
0

See quick gentoo installation: BIOS/GPT. Here you will find sample commands. I've just verified it, works good.

-1

It didn't work out for me.

I tried to switch my HDD to GPT. I created BIOS Boot partition. I installed GRUB as required w/o errors.

After reboot i got errors: E61: Media test failure, check cable.

In short, there is difference:

  1. MBR HDD core.img can be anywhere after MBR, from sector 1 to the start of the first partition (sector 2047 in my case).
  2. GPT HDD, GPT configuration and partition data and starts after MBR from sectors 1 to 33, and core.img has it's own partition.

After I converted back to MBR partition scheme, and reinstalled GRUB, Linux booted normally. So there is no question that boot order was wrong (grub-install doesn't mess with BIOS boot order).

My guess is that grub-install wrongly calculated LBA addresses of core.img and bootimage.img or failed to recognize it's GPT disc and installation corrupted partition data. If boot fails, control returns to BIOS, BIOS interpreted retcode from failed boot attempt as HDD error.

Anyway Some Legacy BIOS has issues with GPT, and there is not 100% guarantee that there will be no issues: https://www.rodsbooks.com/gdisk/bios.html

6
  • 2
    Your investigation is incomplete. The core.img isn't loaded by BIOS itself, but by GRUB's MBR bootcode (i.e. boot.img) – which can load core.img from any LBA (sector location) and is automatically customized by grub-install to know the correct starting sector. (This happens even on regular BIOS+MBR systems, if grub-install detects that sector 1 is already in use by something else.) That means core.img does not have to be located immediately after the MBR. And whether it's in a partition or not doesn't affect how the sector is read – the operations work on whole disk level.
    – user1686
    Jun 20 at 18:16
  • 1
    The error you receive indicates your boot order could be incorrect. Grub on GPT with BIOS boot works 100%. phuclv is correct in his answer. BIOS will simply load the first sector and execute. MBR, GPT, whatever, totally irrelevant. After that, the BIOS is done. // If you cannot get it to work, I suggest you ask a new question.
    – Daniel B
    Jun 20 at 19:40
  • I haven't done any investigation. I just assumed BIOS loads core.img. I was wrong. I checked documentation and saw that MBR bootstrap code loads core.img, and that grub-install sets LBA adress of bootimage.img and core.img. So I assume grub-install sets wrong LBA and I can only guess that grub-install fails to recognize GPT partition scheme.
    – dražen g
    Jun 22 at 16:23
  • My 2006 Toshiba laptop that is BIOS only, works just fine with gpt partitioning as long as I have a bios_grub partition. So did grub2 correctly install?
    – oldfred
    Jun 22 at 17:07
  • Installation was OK, IDK if adding -target=i386-pc argument may help. I created BIOS_grub on sectors 34-2047. After reverting to MBR everything was OK.
    – dražen g
    Jun 22 at 17:39

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.