Repository navigation
Conversation
When an existing swap partition is active on a target disk, lsblk reports '[SWAP]' in its mountpoints array. Previously, DeviceHandler.umount_all_existing() called umount() on LINUX_SWAP partitions, causing umount() to execute 'umount -R [SWAP]' (which fails with exit code 32) and leaving swap active on the device so subsequent partition table modifications fail with 'Device or resource busy'. Add a swapoff() helper in archinstall.lib.disk.utils, call it for LINUX_SWAP partitions in umount_all_existing(), and filter out '[SWAP]' in umount().
Kolgrim33
force-pushed
the
fix/swapoff-existing-partitions
branch
from
October 25, 2026 18:59
17594da to
b15f2d8
Compare
Contributor
|
Not sure about the policy here with tests, we used not to add too many and just rely on repro then re-run. |
This branch has not been deployed
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.
PR Description:
When an existing swap partition is active on a target disk,
lsblk --jsonreports"[SWAP]"in itsmountpointslist.Previously,
DeviceHandler.umount_all_existing()passedFilesystemType.LINUX_SWAPpartitions toumount(partition.path, recursive=True), which attempted to executeumount -R [SWAP](failing with exit code 32) and never disabled active swap on the partition—causing subsequentpartedoperations to fail withDevice or resource busy.This PR:
swapoff()helper inarchinstall.lib.disk.utilsthat disables swap when[SWAP]is present inlsblk_info.mountpoints.swapoff(partition.path)forFilesystemType.LINUX_SWAPpartitions inDeviceHandler.umount_all_existing().Path('[SWAP]')inumount()so pseudo-mountpoints are never passed toumount.tests/test_swapoff_existing.py.Tests and Checks