btrfs improvements and fixes (#2970)
This commit is contained in:
parent
60842bd1cf
commit
256f206b9e
|
|
@ -599,12 +599,12 @@ class DeviceHandler:
|
|||
|
||||
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:
|
||||
|
|
@ -653,12 +653,12 @@ class DeviceHandler:
|
|||
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ class SubvolumeMenu(ListManager):
|
|||
path = prompt_dir(
|
||||
str(_("Subvolume mountpoint")),
|
||||
header=header,
|
||||
allow_skip=True
|
||||
allow_skip=True,
|
||||
validate=False
|
||||
)
|
||||
|
||||
if not path:
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ class Installer:
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue