Repository navigation
fix(dstack-util): re-initialize a data disk whose initialization was interrupted - #1339
Merged
Merged
Conversation
kvinwang
force-pushed
the
fix/luks-half-initialized-disk
branch
2 times, most recently
from
September 24, 2026 15:08
ed1637d to
f43d4df
Compare
…interrupted A first boot interrupted between luksFormat and mkfs left a LUKS header with no filesystem behind it, so every later boot failed to mount the data disk and the CVM rebooted forever. luksFormat now sets the LUKS2 label `dstack-initializing`, and the label is cleared once the filesystem exists. A disk that still carries the label is initialized again; any other disk is mounted as before, so a damaged but recoverable filesystem is never reformatted. The header validator accepts this one label and reports it from the header it already validated.
kvinwang
force-pushed
the
fix/luks-half-initialized-disk
branch
from
September 24, 2026 15:26
f43d4df to
1181b71
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A first boot interrupted between
luksFormatandmkfsleaves a LUKS header with no filesystem behind it. Every later boot fails to mount the data disk and the CVM reboots forever.Change
luksFormatsets the LUKS2 labeldstack-initializing; it is cleared (cryptsetup config --label=) once the filesystem exists.zpool labelclear -fdrops a pool label left by an interruption afterzpool create, which would otherwise blockzpool create(ext4 already usesmkfs.ext4 -F). First-time initialization is unchanged.Disks initialized by earlier builds have an empty label and are unaffected. The label is in the unauthenticated header, so a host can force a re-initialization, but it could already do so by erasing the header.
Verification
cargo test -p dstack-util(112 passed), fmt, clippy clean.cryptsetup luksFormat --label dstack-initializingand aftercryptsetup config --label=validate asOk(true)/Ok(false).mkfs.ext4thencryptsetup config --label=succeeds, the label is gone, and the ext4 behind it is intact.