Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set allow discards on luksOpen #370

Merged
merged 1 commit into from
Jan 24, 2023
Merged

Conversation

apricote
Copy link
Member

By default Hetzner Cloud uses thin provisioning for Volumes. This way, only the space that is actually used by the customer needs to be allocated in the storage pools.

Encrypting the volumes using LUKS breaks this thin provisioning, and the full amount needs to be allocated.

By setting allow-discards when mounting the volume, we tell the driver to use TRIM/discard, which re-enables the thin-provisioning for the volume.

This can be done when creating the LUKS partition, or when mounting it. By doing it on the mount, this will also be enabled for volumes that already exist prior to this commit when they are being re-attach anyway.

By default Hetzner Cloud uses thin provisioning for Volumes. This way,
only the space that is actually used by the customer needs to be
allocated in the storage pools.

Encrypting the volumes using LUKS breaks this thin provisioning, and the
full amount needs to be allocated.

By setting allow-discards when mounting the volume, we tell the driver
to use TRIM/discard, which re-enables the thin-provisioning for the
volume.

This can be done when creating the LUKS partition, or when mounting it.
By doing it on the mount, this will also be enabled for volumes that
already exist prior to this commit when they are being re-attach anyway.
@apricote apricote added the enhancement New feature or request label Jan 24, 2023
@apricote apricote self-assigned this Jan 24, 2023
Copy link
Contributor

@samcday samcday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! 👍

@apricote apricote merged commit ddf6412 into main Jan 24, 2023
@apricote apricote deleted the volume-cryptsetup-discards branch January 24, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants