Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs improvements and fixes #2970

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,12 @@ def create_lvm_btrfs_subvolumes(

self.mount(path, self._TMP_BTRFS_MOUNT, create_target_mountpoint=True)

for sub_vol in btrfs_subvols:
for sub_vol in sorted(btrfs_subvols, key=lambda x: x.name):
debug(f'Creating subvolume: {sub_vol.name}')

subvol_path = self._TMP_BTRFS_MOUNT / sub_vol.name

SysCommand(f"btrfs subvolume create {subvol_path}")
SysCommand(f"btrfs subvolume create -p {subvol_path}")

if BtrfsMountOption.nodatacow.value in mount_options:
try:
Expand Down Expand Up @@ -653,12 +653,12 @@ def create_btrfs_volumes(
options=part_mod.mount_options
)

for sub_vol in part_mod.btrfs_subvols:
for sub_vol in sorted(part_mod.btrfs_subvols, key=lambda x: x.name):
debug(f'Creating subvolume: {sub_vol.name}')

subvol_path = self._TMP_BTRFS_MOUNT / sub_vol.name

SysCommand(f"btrfs subvolume create {subvol_path}")
SysCommand(f"btrfs subvolume create -p {subvol_path}")

self.umount(dev_path)

Expand Down
3 changes: 2 additions & 1 deletion archinstall/lib/disk/subvolume_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def _add_subvolume(self, preset: SubvolumeModification | None = None) -> Subvolu
path = prompt_dir(
str(_("Subvolume mountpoint")),
header=header,
allow_skip=True
allow_skip=True,
validate=False
)

if not path:
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def _mount_btrfs_subvol(
subvolumes: list[disk.SubvolumeModification],
mount_options: list[str] = []
) -> None:
for subvol in subvolumes:
for subvol in sorted(subvolumes, key=lambda x: x.relative_mountpoint):
mountpoint = self.target / subvol.relative_mountpoint
mount_options = mount_options + [f'subvol={subvol.name}']
disk.device_handler.mount(dev_path, mountpoint, options=mount_options)
Expand Down