I'm deploying AMD64 nodes with a 3TB first disk with MAAS but I only get a 2TB partition because curtin uses MBR instead of GPT for the partitioning.
Curtin tries to choose the most appropriate partition table type for a given node:
- For systems that are booting in BIOS mode, it defaults to an MBR-stored DOS partition table
- For systems that are booting in UEFI mode (including ARMv8-based UEFI-enabled systems like Cavium Thunder and APM X-Gene) it defaults to a GPT partition table
Therefore, the easiest way to get a GPT partition table is to configure the node to boot in UEFI mode, which is supported starting with MAAS 1.5.
There are two additional ways to get curtin to create GPT partitions:
You can modify the curtin configuration provided by MAAS to curtin in
block-meta: format: gpt
If you have up to 4 partitions, you can easily convert DOS partition tables to GPT partitions post-installation. Curtin makes an effort to leave enough space in the partitioning to allow the conversion to successfully happen, and from r224 onwards it ensures it. Converting can be done with:
sgdisk --mbrtogpt <device>
I have tried a number of workarounds (including the one suggested in kiko's solution) to no avail.
The following works pretty reliably, at least with MAAS 2.3.5 running on Xenial:
- Commission the node and partition its disk as you would normally (eg: using the web UI) but stop before deploying the node.
- Run the following cmd-line query:
maas $USER block-devices read $nodeid(
$nodeidcan be read from the URL on the web UI for example; it's an internal six alphanum identifier for the node)
- Grab the block device
id. You'll see that
- Now sign-on to MAAS' Postgres DB:
sudo -u postgres psql -d maasdb
- Update the partitioning scheme to GPT,
update maasserver_partitiontable set table_type='GPT' where block_device_id=$block_dev_id(substitute `$block_dev_id with the id you read at step 3)
- Optionally repeat the query from step 2 and check that the
partition_table_typehas been updated to
- Deploy the node and enjoy your GPT partition table.
This isn't particularly pretty as hacking directly in MAAS' DB feels a bit off-limits but it's the next best thing until we get given a way to do this through a public API. The kind of API I have in mind would be smth like:
maas $USER block-device update $node_id $block_device_id partition_table_type=GPT. This API already exists and allows updating the
name of the block device as documented, but ignores the much more useful
Note: if you need to leave unpartitioned space on the GPT target disk, beware that this procedure appears to trigger a "feature" whereby that space gets absorbed by the last partition you lay out in MAAS. A workaround is to create a throw-away partition and delete it after deployment.