Last active
August 5, 2021 19:33
-
-
Save briceburg/dedfccff6b6f855aede703e7f6619e97 to your computer and use it in GitHub Desktop.
convert Ubuntu AMI from MBR partitioning to GPT partitioning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the following assumes AWS nitro (e.g. t3.*, m5.*, &c) instances (which use /dev/nvme0n1 as root disk) | |
// "safely" switches from MBR to GPT partitioning in Ubuntu < 21.04 or other AMIS. | |
// Tested using gdisk 1.0.3 from 18.04 / Bionic. | |
// after the change, you can use >2TB root disks. either initially, or by resizing a smaller one -- in nitro and non-nitro types | |
provisioners: [ | |
{ | |
"type": "shell", | |
"inline": [ | |
"echo Converting to GPT - AWS nitro type instance", | |
"sudo sgdisk /dev/nvme0n1 --mbrtogpt --new=2:34:2047 --typecode=2:ef02", | |
"sudo partprobe", | |
"sudo grub-install /dev/nvme0n1" | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment