Skip to content

fix(dstack-util): re-initialize a data disk whose LUKS header has no filesystem - #1339

Open
kvinwang wants to merge 1 commit into
nextfrom
fix/luks-half-initialized-disk
Open

kvinwang wants to merge 1 commit into
nextfrom
fix/luks-half-initialized-disk

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

For encrypted storage is_disk_initialized only checks for a LUKS header. A first boot interrupted between luksFormat and mkfs leaves a header with no filesystem; every later boot then opens the volume, fails to import/mount it, and dstack-prepare.service reboots the CVM with no start limit, forever.

Now an encrypted, initialized disk is opened first and probed with blkid -p; only blkid's "nothing found" (exit 2) triggers filesystem creation. Any other outcome is treated as "has a filesystem", so a probe failure can never reformat existing data.

Split out of #1243.

…filesystem

A first boot interrupted between luksFormat and mkfs left a LUKS header
with no filesystem. Later boots treated the disk as initialized, failed
to import it, and rebooted forever. Open the volume first and only
create the filesystem when blkid finds nothing on it.
@kvinwang
kvinwang force-pushed the fix/luks-half-initialized-disk branch from 49f2b08 to ed1637d Compare September 23, 2026 08:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant