Skip to content

Commit

Permalink
Disabled fstrim on BTRFS by default (#2109)
Browse files Browse the repository at this point in the history
* Disabled fstrim on BTRFS by default

* Changed variable name to conform with suggestion in #2109
  • Loading branch information
Torxed committed Sep 26, 2023
1 parent b141609 commit c427391
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ def minimal_installation(
hostname: str = 'archinstall',
locale_config: LocaleConfiguration = LocaleConfiguration.default()
):
_disable_fstrim = False
for mod in self._disk_config.device_modifications:
for part in mod.partitions:
if part.fs_type is not None:
Expand All @@ -597,6 +598,10 @@ def minimal_installation(
if (binary := part.fs_type.installation_binary) is not None:
self._binaries.append(binary)

# https://github.com/archlinux/archinstall/issues/1837
if part.fs_type.fs_type_mount == 'btrfs':
_disable_fstrim = True

# There is not yet an fsck tool for NTFS. If it's being used for the root filesystem, the hook should be removed.
if part.fs_type.fs_type_mount == 'ntfs3' and part.mountpoint == self.target:
if 'fsck' in self._hooks:
Expand Down Expand Up @@ -651,7 +656,10 @@ def minimal_installation(
# periodic TRIM by default.
#
# https://github.com/archlinux/archinstall/issues/880
self.enable_periodic_trim()
# https://github.com/archlinux/archinstall/issues/1837
# https://github.com/archlinux/archinstall/issues/1841
if not _disable_fstrim:
self.enable_periodic_trim()

# TODO: Support locale and timezone
# os.remove(f'{self.target}/etc/localtime')
Expand Down

0 comments on commit c427391

Please sign in to comment.