← Back to Pull requests

Release the install disk before archinstall partitions it #327

Open
unknown opened this pull request with 456 lines diff across 5 files
View on GitHub
unknown unknown commented on Oct 25, 2026 13:15 UTC
Author

A disk that has had a life before Omarchy can stop a whole-disk install before it starts. The live ISO ships mdadm and lvm2, and their udev rules assemble an old RAID member and activate an old volume group the moment the disk appears. omarchy-iso-cleanup-disk deactivated volume groups and closed crypt devices, but never stopped md arrays, swallowed every failure with || true, and never checked that it had actually freed the disk. With an old RAID1 member on the second partition, 4.0.6 stops in "Installing Arch + Omarchy" on all three of the adapter's retries with "Partition(s) 1, 2 on /dev/vda have been written, but we have been unable to inform the kernel of the change": the array holds the old partition, so the kernel keeps the old table.

The cleanup now takes down everything stacked on the disk from the top, by walking /sys/class/block/*/holders, whatever each holder is: device-mapper (crypt, LVM or anything else) through dmsetup remove, md through mdadm --stop, unmounting and swapping off each device first. It then wipes every partition's signatures, and the disk's own except its partition table, so udev has nothing left to reassemble, and proves the disk is free with blockdev --rereadpt, which the kernel refuses while anything holds a partition. Each attempt waits out activation udev has already begun and holds the disk's lock while it releases and wipes, which udevd honours, so nothing can be assembled between reading the stack and wiping it. If the disk still will not come free, the install stops in "Preparing live environment" saying what holds it, rather than in archinstall with a pyparted traceback.

The partition table itself is left in place on purpose. archinstall lists the disk's partitions when it is imported, before the cleanup runs, and wipe_dev then opens each old partition path with open(path, 'wb'): a path the kernel had already dropped would become a regular file in /dev. A holder shared with another disk, a RAID1 whose other half is on sdb, is stopped too, because the target cannot be partitioned while it runs; stopping writes nothing to the other disk's data, and its member is left degraded either way since its partner is being wiped.

When archinstall's disk operations still fail, the install log now records the disk as it was at that moment: lsblk, what is at each partition path in /dev (a regular file there is how the case above would look), each partition's holders and signatures, and the tail of dmesg. A report with only a photo of the failure screen and a support log, like the unencrypted install that stopped at mount -o compress=zstd /dev/sda2 /mnt/arch_btrfs, then carries what explains it. That report is not reproduced here: reinstalling over a previous unencrypted Omarchy, a previous encrypted one, and an old LVM install all succeed on 4.0.6, and only the RAID member fails, one step earlier than the photo.

CI only ever installed onto a blank disk. The new used-disk integration scenario boots the live ISO once to leave an Ubuntu-server-style disk behind (an ESP, then a RAID1 member carrying LVM with swap and an ext4 root), installs unattended over it, and checks the installed system boots on btrfs with no RAID or LVM left; it fails on 4.0.6 with the error above. It runs in the install test beside boot. To share the boot-and-wait loop, install_phase now calls install_unattended <disk> <serial-log>.

Written by Claude Opus 5.5 and reviewed by Codex Medium as a second opinion. The one point of Codex's this does not take is stopping a holder shared with another disk, for the reason above; that is the maintainer's call.

Diff: 456 lines (+342 / -114) across 5 files Reviewer: greptile-apps[bot] Review duration: 14m
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 456 lines diff across 5 files
0.46
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.366
Shallow Review Depth shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #327"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 45.5% (MEDIUM) · Higher = larger blast radius
45.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 24.2% · Safe to merge
24.2%