fix(installer): verify mounts after installer completion

Add verification that critical mounts (root and ESP) are still
intact after void-installer exits. Catches cases where installer
accidentally reformats filesystems despite instructions.

Fail fast with clear error message if mounts disappeared, rather
than proceeding to post-install and encountering cryptic errors.

Decision: Check mounts immediately after installer rather than
during post-install to provide clear failure point and message.

Alternative considered: Monitor installer process to prevent
reformatting, rejected as too invasive and complex.
This commit is contained in:
Stefan Strobl 2025-12-24 15:25:42 +01:00
parent c303a75192
commit 551cb98a9d

View File

@ -58,4 +58,14 @@ run_installer() {
fi fi
read -r -p "Press Enter once the installer is complete..." _ read -r -p "Press Enter once the installer is complete..." _
# Verify critical mounts are still intact after installer
if ! findmnt "$MOUNT_ROOT" >/dev/null 2>&1; then
die "Root mount disappeared after installer. The installer may have reformatted the filesystem."
fi
if ! findmnt "$ESP_MOUNT" >/dev/null 2>&1; then
die "ESP mount disappeared after installer. The installer may have reformatted the filesystem."
fi
log_info "Mount verification passed."
} }