Is it possible to install Centos on a GPT labeled disk?

General support questions
Post Reply
ftarz
Posts: 11
Joined: 2013/01/24 14:54:37

Is it possible to install Centos on a GPT labeled disk?

Post by ftarz » 2014/12/31 19:43:49

I've been trying to do an EFI install of Centos 7 on a new Supermicro X9DBL motherboard with 2TB SAS harddisks. I've tried installing from the Centos Live CD, the X86_64 DVD and the X86_64-Everything DVD. Each time the installation goes all the way to completion but can't find grub upon rebooting. Iv'e tried booting off the Live CD, selecting rescue and trying to install grub/grub2 but it doesn't work.

I am able to install FreeBSD 10.1 or UBUNTU 14.0 on this box just fine and they will boot-up OK.

After doing some digging I found that the Centos install media doesn't have the necessary files for handling a GPT labeled harddisk. They will work just fine with MBR labeled drives, but that's not what I'm looking for.

I found this on the Red Hat website: https://access.redhat.com/solutions/15224
ISSUE

On the x86 and x86_64 architectures, Red Hat Enterprise Linux uses the DOS MBR partitioning format for its boot device. This partitioning scheme supports a maximum size of 2.2 terabytes (TB) per disk. Red Hat Enterprise Linux 4 and 5 provide support for drives that are larger than 2.2TB through an alternative partitioning scheme, GUID partition table (GPT). The legacy PC BIOS is unable to boot off of GPT-partitioned disks and so the boot disk must use the DOS MBR partition table. This limitation does not apply to the Itanium (ia64) architecture, which is able to boot off of GPT disks.

After installation has completed, the parted disk partitioning tool can be used to apply a GPT partition table to devices which are to be used for data only.
But changing the disk label from MBR back to GPT for a boot disk isn't a great thing to do.

This is not a Linux issue, but a RHEL installation issue. Does anyone have a recipe how to add the necessary grub2 files to a Centos system post installation to support GPT labeled harddisks?

Frank

chemal
Posts: 682
Joined: 2013/12/08 19:44:49

Re: Is it possible to install Centos on a GPT labeled disk?

Post by chemal » 2014/12/31 22:25:12

That RH article you found refers to yesteryear, i.e. C4 and C5. C6 and C7 can be installed on GPT labeled disks and boot from them with or without UEFI. If you need help to should give more details.

ftarz
Posts: 11
Joined: 2013/01/24 14:54:37

Re: Is it possible to install Centos on a GPT labeled disk?

Post by ftarz » 2015/01/01 04:42:28

OK then here are a few details:

I conducted a few tests using FreeBSD-10.1 and UBUNTU 14.0 DVDs. In each case the I used a GPARTED Live CD to clear any partitions from the hard disk and install a GPT label on the disk. I installed a minimum install using the default disk partitioning from the installer. I booted each DVD by selecting the UEFI DVD boot entry in the boot menu.
Image

In each case for FreeBSD or UBUNTU the install went to completion and I was able to reboot the box and login to the OS.

I then conducted the same test using a Centos 7.0.1406 Live CD, DVD and Everything DVD. In each case the I used a GPARTED Live CD to clear any partitions from the hard disk and install a GPT label on the disk. I installed a minimum install using the default disk partitioning from the installer. I booted each DVD by selecting the UEFI DVD boot entry in the boot menu. In each case the install went to completion but I received an error upon rebooting the box.
Image

I then conducted the same test using a RHEL-server-7.1-beta DVD. I used a GPARTED Live CD to clear any partitions from the hard disk and install a GPT label on the disk. I installed a minimum install using the default disk partitioning from the installer. I booted the DVD by selecting the UEFI DVD boot entry in the boot menu. The install went to completion but I received the same error upon rebooting the box.

I then rebooted the box using the Centos 7.0.1406 Live CD, selected OS rescue, mounted the hard disk on /mnt and chrooted to the hard disk root. I tried to reinstall grub2 on the hard disk but got another error. It seems that no files existed in /usr/lib/grub on the hard disk.
Image

I them rebooted the box using the Centos Live CD and mounted the hard disk. I copied the content from /usr/lib/grub on the CD to the hard disk, chrooted to the hard disk root and tried again the reinstall grub. I got another error that grub could not be installed due to disk having a GPT label.
Image

I then cleared the partitions on the hard disk using GPARTED and installed a MSDOS label on the disk. Then I installed a minimum install using the default disk partitioning from the installer. I booted the DVD by selecting the UEFI DVD boot entry in the boot menu. The install went to completion and upon rebooting the box the OS came-up and I was able to login. To confirm that the disk did not have a GPT label I ran parted:
Image

So from this evidence I conclude that FreeBSD and UBUNTU can install on a hard disk with a GPT label, while Centos and RHEL will not successfully reboot when installed on a disk with a GPT label.

I also notice that the full text of the Red Hat webpage that refers to this issue also states:
ISSUE

On the x86 and x86_64 architectures, Red Hat Enterprise Linux uses the DOS MBR partitioning format for its boot device. This partitioning scheme supports a maximum size of 2.2 terabytes (TB) per disk. Red Hat Enterprise Linux 4 and 5 provide support for drives that are larger than 2.2TB through an alternative partitioning scheme, GUID partition table (GPT). The legacy PC BIOS is unable to boot off of GPT-partitioned disks and so the boot disk must use the DOS MBR partition table. This limitation does not apply to the Itanium (ia64) architecture, which is able to boot off of GPT disks.

After installation has completed, the parted disk partitioning tool can be used to apply a GPT partition table to devices which are to be used for data only.

ENVIRONMENT

Red Hat Enterprise Linux 4
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
Boot disk exceeding 2.2TB
Certainly looks like this issue is relevant to what I am seeing about installing Centos on a GPT labeled hard disk.

Frank

User avatar
toracat
Forum Moderator
Posts: 7439
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Is it possible to install Centos on a GPT labeled disk?

Post by toracat » 2015/01/01 18:21:45

That Red Hat article is "incomplete" unless you read the portion that is accessible only to the registered RH users. The publicly visible content does not have the info for RHEL 7.

At any rate, yes, it should be possible to install RHEL/CentOS 7 on a disk with a gpt partition table as far as the system is booting in UEFI mode. Could you double-check on this point?
CentOS Forum FAQ

chemal
Posts: 682
Joined: 2013/12/08 19:44:49

Re: Is it possible to install Centos on a GPT labeled disk?

Post by chemal » 2015/01/01 21:24:05

There are two ways to install C7 on a GPT disk.

1) Legacy, non-UEFI mode: then you need a bios boot partition.

2) UEFI mode: then you need an efi system partition.

Grub2 is installed differently with 1) or 2). You choose by doing the installation in either Legacy or UEFI mode. Afterwards you have to stick to that and can only boot the system in one way. You cannot change this afterwards.

From your output, you managed to install in UEFI mode, but your grub2 ist set up for MBR partitioning: root=hd0,msdos3! No idea how you did that.

Suggestion: Overwrite the beginning of your disk with zeros, then leave it alone. Let the C7 installer do everything. Also dont use the live cd, but the regular installation medium.

Post Reply

Return to “CentOS 7 - General Support”