Force Anaconda To Use GPT Labels On All Drives?

Home » CentOS » Force Anaconda To Use GPT Labels On All Drives?
CentOS 3 Comments

I did a quick search through the archive and couldn’t find anything that mapped to my need, so I figured I should ping the community and see if anyone has the requisite knowledge and could point me in the right direction.

*Succinct Version*
Is there a way to, using updates.img, monkey patching or swapping in a newer Anaconda (>= 16) to force all disks to have gpt labels and not just disks> 2TB?

*TL;DR Version*
I’m working on setting up an installation environment and am trying to make it as machine agnostic as possible. We’re currently using CentOS 6.3 (will start 6.4 work soon). Getting software on a machine is simple but laying out disks is less so. Some of our machines have eight disks and some twelve and some others have two. Normenpoughaalizing on a single hardware profile is not an option, due to the various types of systems we need.

What I’m currently having to do is wipe the partition information and set a gpt label, in a %pre section, on the first two disks only. After that, I
have to use our post installation installer to create the partitions on the remaining disks. Because of the way it works, unless we manually remove the partitions from the remaining partitions, prior to doing the post installation steps (which setup the host for its role), we will end up with drives that have old information (read as: not formatted).

I understand that that normal way to do this is to use zerombr and clearpart but this leaves me with some disks that have msdos labels (<2TB) and some with gpt labels (> 2TB). In order to simplify everything, without having to be deterministic about hardware type, we need to use gpt labels on everything.

It appears that Anaconda 16 and beyond use gpt labels by default (unless
“nogpt” is provided as a kernel option) but CentOS (even 6.4) is using Anaconda 13. I’ve read about updates.img but I’m not sure that’s the solution (if so, I don’t grok it yet). I’ve managed to get Anaconda 17 to build from source (wow… that was “fun”) but don’t know enough kickstart/anaconda to know how and if I can swap that in place of the existing Anaconda images and still get CentOS to install.

3 thoughts on - Force Anaconda To Use GPT Labels On All Drives?

  • yes

    did you try setting : X86._disklabel_types = [‘gpt’]

    also, worth noting that if you use EFI, its always going to be gpt

  • I have not, as I was unaware this was possible. How/Where do I set that?
    I assume it’s either a kernel option or something I put in %pre (is it a literal in %per?)… ? I found the method that checks that value but am not currently familiar enough with the code involved to trace it back.

    I’ve read a few things to that affect but we’re currently not using EFI. I’m sure most (if not all) of our hardware is EFI capable but I don’t know enough about it right now and don’t have the cycles to recertify all of our processes again. I will keep it in mind for the future though.