Skip to content

growpart: Automatic partition resize prevents unlocking of encrypted root partition #46

@TheRealFalcon

Description

@TheRealFalcon

From https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1991554:

I modified the Ubuntu Server image so the root partition is encrypted. Since the Raspberry Pi 4b does not have hardware acceleration for AES I use adiantum for encryption. To take full advantage of its advertised performance gains, I used '--sector-size 4096' with cryptsetup. A requirement for this parameter to work is that the containing partition is aligned, at its start and end, to sector counts evenly divisible by 8.

When unlocking the partition, cryptsetup does apperently check if partition boundaries are evenly divisible by 8. On the first boot this is true, for any consecutive it is not. To me it seems cloud-init resizes the root partition (through growpart) to the maximum size possible. Sadly by doing so it interferes with the peculiar alignment requirements of cryptsetup.

It would be great if the root partition could end at an 1MiB boundary after resize.

In order for cloud-init to do this, growpart would need to support ending at a particular boundary, which I currently see no flags to make that happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions