Install CentOS 7 On MBR Hard Disk

Home » CentOS » Install CentOS 7 On MBR Hard Disk
CentOS 17 Comments

I have a UEFI system, but I want to install CentOS on a MBR (not GPT)
hard disk.

The installation program keeps telling me that I must create an “EFI
system partition on a GPT disk mounted at /boot/efi”.

I can’t find a way to work around this. Is there a solution?

17 thoughts on - Install CentOS 7 On MBR Hard Disk

  • If the installer is doing that then it usually means that the UEFI
    firmware is either a) not in BIOS compatibility mode b) does not respond in a way that Linux detects or c) the disk is larger than what BIOS compatibility mode will allow.

    Otherwise anaconda should default to MBR unless it finds the hardware does not know how to deal with MBR.

    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-anaconda-boot-options

  • Stephen J Smoogen wrote:

    On the MBR disk, I already have a CentOS 6 partition which works well. I presume that means that there’s no problem with the UEFI firmware, no?

    (The disk has 240 GB; size isn’t the problem.)

  • I had the same issue back when I installed 7.x on this box. I couldn’t find a way around it, so I finally just went with the flow.

    I definitely DID have it in legacy mode, or at least the firmware’s GUI said I did.

  • OK I am going with documentation not being right and/or I have been very lucky with my installs.

    The only other thing I can think of is that the disk was already formatted to GPT. In that case it has to be EFI. [I had a disk which was GPT partitioned and removing that was quite a challenge as I had done a ‘dd if=/dev/zero of=/dev/sda bsQ2 count’ and it still kept coming up as GPT. I believe I had to run a different disk command to really clean it.]

  • Stephen John Smoogen wrote:

    If you read https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-disk-partitioning-setup-x86#sect-bootloader-mbr-gpt-x86
    carefully, it seems to say that if you have UEFI and an MBR hard disk that already has partitions, you must reformat it to GPT.

    The documentation seems to say that Anaconda will use MBR only if the disk is the right size (fewer than 2^32 sectors) *and* has no partition.

  • I am guessing because my drives were blank and smaller than 2 TB that it defaulted to MBR even when the system had a UEFI BIOS (as long as the firmware is in legacy mode).

    What is the partition table of the drive you are trying to install to?

  • Stephen John Smoogen wrote:

    Right, the problem seems to arise if you already have partitions on your MBR disk. Perhaps Fred Smith can confirm this.

    MBR, 240 GB (an SSD), with CentOS 6 already installed on a partition.
    (There are also other partitions.)

  • OK wild guess on install options as sometimes they will do this but not say they did it. Try adding inst.gpt

  • Well, it’s been a couple of years, but as best I recall, I had two brand-new 1TB drives, intending to use them as RAID-1, and the BIOS was
    (should have been, it said it was) in legacy mode. I thought it was pretty weird that Anaconda wouldn’t let me proceed beyond partitioning/
    fs creation without setting up the EFI partition.

    Somewhat more recently, I got a new system at work, containing Win10
    (not a factory installation, but freshly installed by my employer
    ’cause they don’t trust factory installation) and it already had UEFI in legacy mode by the time I got it. so when I installed C-7
    on it, I had none of that garbage about requiring the EFI partition, it just sailed smoothly past it.

    Go Figure!

  • Stephen J Smoogen wrote:

    Sorry, that didn’t work. Nor did installing CentOS 7 without a boot loader, chroot-ing into it, and trying to install grub2 manually:

    grub2-install /dev/sda –target=i386-pc grub2-mkconfig -o /boot/grub2/grub.cfg

    I didn’t realize you were the culprit, so that’s OK. ;-)

  • Hmmm if that didn’t work then there is something in the bootup which keeps telling grub/kernel you are an EFI only system. EL6 would have installed because EFI support at that point was mainly a “eh oh yeah we need to cover that?” type thing. EL7 should be clearer on this but it might have gone the other way.

    Can you try to see if Fedora 27 has the same problem? If it has then this is a problem that upstream needs to fix on EL releases. If it isn’t then I would lean more towards the motherboard/bios combo saying something which says “my legacy support is iffy.. use EFI”.

    After that it is usually what is the motherboard/bios level and is it updated type fixes then.

    Well I am not the culprit.. it is just most of my ideas have been completely useless.

  • Why?

    While the UEFI spec permits using MBR for booting, it’s confusing because there’s no actual single standard for MBR. There is for GPT.

    Anyway, all OS installers I’m aware of on multiple platforms enforce GPT
    for UEFI installations.

    Yes, but it means giving bad advice. And that is to enable “legacy” OS
    support to present a faux BIOS to the booting system instead of exposing UEFI. It’s bad advice because you have no good reason for wanting to use MBR, it’s an arbitrary request.

    Chris Murphy

  • GPT has primary login at drive start, and backup location at drive end. To remove it requires wipefs -a /dev/ and it will remove the signature found in both primary and backup.

    Chris Murphy

  • So is the end goal to have dual boot? You want to preserve the existing Cent OS installation on this drive and also install Cent OS 7?

    The biggest problem is the installer is really not very smart when it comes to this use case. It’s friendly for Windows and macOS dual boot, but fairly well faceplants with dual boot Linux. So invariably you have manual surgery to do pre and post install, or suffer.

    Run ‘efibootmgr’ by itself, if you get boot entries the system is definitely UEFI booted. If you get an error, it’s legacy/faux-BIOS booted.

    Certainly legacy boot is the easiest work around, but it can have an effect on various things including drive and video modes that might be different than UEFI booting. e.g. one of my older systems when booting legacy brings up the SSD in IDE mode not SATA, and the system is slower. And it can only use discrete GPU, the integrated GPU is unavailable. So I advise testing before committing to legacy mode.

    Also, rare, but not all UEFI systems come with a Compatiblity Support Module (fake BIOS), in which case you’re stuck.

    Chris Murphy

  • Stephen John Smoogen wrote:

    I had no problem installing Fedora 27, so I guess the problem is my system. Oh well.

    Thanks for the help!