[linux-azure] Disk Partition Issue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-azure (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
In testing with the “Canonical UbuntuServer 19.04 latest” image from the Azure Marketplace, we’re seeing these lines output in dmesg:
lisa@LISAv2-
[ 17.228278] GPT:Primary header thinks Alt. header is not at the end of the disk.
[ 17.237240] GPT:4612095 != 62914559
[ 17.259079] GPT:Alternate GPT header not at the end of the disk.
[ 17.259080] GPT:4612095 != 62914559
[ 17.259080] GPT: Use GNU Parted to correct GPT errors.
It looks like maybe the disk partition structure in the image isn’t quite correct. Linux continues to boot, and the reported errors don’t cause any obvious problems, but it seems like this is something that should be corrected.
This is as expected, the root partition in the registered image will not match the size of the disk that is deployed. It will be large enough to contain the root partition and provide some blank space. This is by design and allows VMs to be started with variable size disks. This is seen early in boot before cloud-init runs and because the disk from the image builder is smaller it will leave the gpt backup table in the middle of the deployed disk, but this is safe. One of the early cloud-init modules is growpart[1] and there's good documentation in the link for that module, but by default that module will grow the partition for the root filesystem to fill the disk and then grow the filesystem to fill that partition. In doing this the gpt backup table will be moved to a location correct for the root disk size at deployemtn; this is why you don't see the warning after reboot. In addition to giving flexibility for launching with different size root disks the user can instruct cloud-init not to resize the root filesystem[2][3] and instead use the unused space to create other partitions and filesystems[4].
[1] https:/ /git.launchpad. net/cloud- init/tree/ cloudinit/ config/ cc_growpart. py /cloudinit. readthedocs. io/en/latest/ topics/ modules. html#growpart /cloudinit. readthedocs. io/en/latest/ topics/ modules. html#resizefs /cloudinit. readthedocs. io/en/latest/ topics/ modules. html#disk- setup
[2] https:/
[3] https:/
[4] https:/