Skip to content

fix(disk): pass mountpoint and subvolume paths as argv lists to SysCommand - #4880

Open
Kolgrim33 wants to merge 1 commit into
archlinux:masterfrom
Kolgrim33:fix/mountpoint-spaces
Open

Kolgrim33 wants to merge 1 commit into
archlinux:masterfrom
Kolgrim33:fix/mountpoint-spaces

Conversation

@Kolgrim33

Copy link
Copy Markdown

Summary

Fixes #4879.

When a pre-mounted filesystem has a mountpoint containing spaces (such as /mnt/Cleartext Storage), passing an interpolated command string like f'btrfs subvolume list {mountpoint}' or ' '.join(cmd) to SysCommand caused shlex.split() to break the path into multiple arguments:

['/usr/bin/btrfs', 'subvolume', 'list', '/mnt/Cleartext', 'Storage'] exited with abnormal exit code [1]: btrfs subvolume list: exactly 1 argument expected, 2 given

Changes

  • archinstall/lib/disk/device_handler.py:
    • Pass argv lists to SysCommand for btrfs subvolume list, btrfs subvolume create, and chattr.
    • Parse btrfs subvolume list output using line.split(' path ', maxsplit=1)[-1] so subvolume names containing spaces are not truncated.
  • archinstall/lib/disk/utils.py:
    • Pass the already-constructed cmd list directly to SysCommand(cmd) in mount() instead of joining it with spaces first.
  • tests/test_disk_mountpoints.py:
    • Add unit tests covering DeviceHandler.get_btrfs_info() and mount() with spaces in mountpoint paths.

…mmand

Passing shell-unquoted path strings to SysCommand caused shlex.split()
to split mountpoints containing spaces (e.g. '/mnt/Cleartext Storage')
into separate arguments, breaking 'btrfs subvolume list' and 'mount'.

Pass argv lists to SysCommand for btrfs subvolume, chattr, and mount
invocations, parse btrfs subvolume list lines using ' path ' so
subvolume names with spaces are preserved, and add unit tests.

Fixes archlinux#4879
@Kolgrim33
Kolgrim33 requested a review from Torxed as a code owner November 21, 2026 18:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-mounted root with space in mountpoint name not handled correctly

1 participant