From c427391543d464856c8153d17ddeef2c693fcf95 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 26 Sep 2023 09:56:34 +0200 Subject: Disabled fstrim on BTRFS by default (#2109) * Disabled fstrim on BTRFS by default * Changed variable name to conform with suggestion in #2109 --- archinstall/lib/installer.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index a238bb8f..8a0acf64 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -587,6 +587,7 @@ class Installer: 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: @@ -597,6 +598,10 @@ class Installer: 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: @@ -651,7 +656,10 @@ class Installer: # 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') -- cgit v1.2.3-54-g00ecf