partitioning: settle udev and abort on mkfs failure in full_disk_format - #184
Open
ggiesen wants to merge 1 commit into
Open
partitioning: settle udev and abort on mkfs failure in full_disk_format#184ggiesen wants to merge 1 commit into
ggiesen wants to merge 1 commit into
Conversation
Each parted invocation triggers a partition-table rescan during which udev removes and recreates the partition device nodes. On EFI installs (three partitions, plus a trailing 'set 1 boot on') mkfs.ext4 raced a vanishing /dev/vda3: the existence check passed, mke2fs then found no node, and because the failure was tolerated the root mount silently failed and rsync copied the entire system into the live session's tmpfs until ENOSPC. Run 'udevadm settle' before the node-existence check, and raise on a non-zero mkfs exit instead of carrying on with an unformatted target.
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.
full_disk_format()formats each new partition without waiting for udev to settle after parted's table rescan and without checking themkfsreturn code, somkfscan race a briefly-removed partition node; the silent failure later surfaces as a disk-full error when the file copy lands in the live tmpfs.Fix:
udevadm settlebefore the node-existence check after each parted call. parted's rescan briefly removes and recreates the nodes; settling closes that window. No-op ifudevadmis absent (stderr suppressed; falls through to the existingos.path.existsretry loop).os.system(mkfs)returns non-zero — a partition that failed to format must stop the install. This mirrors the existingmklabelreturn-code check a few lines up.Testing (LMDE 7, QEMU/KVM):
mkfs.ext4forced to fail, the install now aborts infull_disk_format()instead of silently continuing into the live tmpfs.Split out of #180 so it can land independently.
Fixes #181