Случайно обратил внимание, что почему-то для раздела /home на ssd в arch linux не срабатывает еженедельный trim через fstrim.service
при запуске вручную всё норм
[root@newpc ~]# /sbin/fstrim --fstab --verbose
/boot/efi: 98.3 MiB (103102976 bytes) trimmed on /dev/sda1
/boot: 0 B (0 bytes) trimmed on /dev/sda2
/home: 764.4 MiB (801562624 bytes) trimmed on /dev/mapper/newpc-home
/: 0 B (0 bytes) trimmed on /dev/mapper/newpc-root
при запуске через сервис получаю для home «the discard operation is not supported»
[root@newpc ~]# systemctl start fstrim.service
[root@newpc ~]# systemctl status fstrim.service
● fstrim.service - Discard unused blocks on filesystems from /etc/fstab
Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static; vendor preset: disabled)
Active: inactive (dead) since Sat 2019-10-26 20:58:14 MSK; 3s ago
Docs: man:fstrim(8)
Process: 167580 ExecStart=/sbin/fstrim --fstab --verbose (code=exited, status=0/SUCCESS)
Main PID: 167580 (code=exited, status=0/SUCCESS)
Oct 26 20:58:13 newpc systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Oct 26 20:58:14 newpc fstrim[167580]: fstrim: /home: the discard operation is not supported
Oct 26 20:58:14 newpc fstrim[167580]: /boot/efi: 98.3 MiB (103102976 bytes) trimmed on /dev/sda1
Oct 26 20:58:14 newpc fstrim[167580]: /boot: 0 B (0 bytes) trimmed on /dev/sda2
Oct 26 20:58:14 newpc fstrim[167580]: /: 54.7 MiB (57360384 bytes) trimmed on /dev/mapper/newpc-root
Oct 26 20:58:14 newpc systemd[1]: fstrim.service: Succeeded.
Oct 26 20:58:14 newpc systemd[1]: Started Discard unused blocks on filesystems from /etc/fstab.
оказалось, что это из-за директивы «ProtectHome=yes» в unit-файле, после её отключения всё стало нормально
[root@newpc ~]# cat /usr/lib/systemd/system/fstrim.service
[Unit]
Description=Discard unused blocks on filesystems from /etc/fstab
Documentation=man:fstrim(8)
[Service]
Type=oneshot
#ExecStart=/sbin/fstrim --fstab --verbose --quiet
ExecStart=/sbin/fstrim --fstab --verbose
ProtectSystem=strict
#ProtectHome=yes
PrivateDevices=no
PrivateNetwork=yes
PrivateUsers=no
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=@default @file-system @basic-io @system-service
[root@newpc ~]# systemctl start fstrim.service
[root@newpc ~]# systemctl status fstrim.service
● fstrim.service - Discard unused blocks on filesystems from /etc/fstab
Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static; vendor preset: disabled)
Active: inactive (dead) since Sat 2019-10-26 21:00:56 MSK; 1s ago
Docs: man:fstrim(8)
Process: 167668 ExecStart=/sbin/fstrim --fstab --verbose (code=exited, status=0/SUCCESS)
Main PID: 167668 (code=exited, status=0/SUCCESS)
Oct 26 21:00:54 newpc systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Oct 26 21:00:56 newpc fstrim[167668]: /boot/efi: 98.3 MiB (103102976 bytes) trimmed on /dev/sda1
Oct 26 21:00:56 newpc fstrim[167668]: /boot: 0 B (0 bytes) trimmed on /dev/sda2
Oct 26 21:00:56 newpc fstrim[167668]: /home: 956.3 MiB (1002754048 bytes) trimmed on /dev/mapper/newpc-home
Oct 26 21:00:56 newpc fstrim[167668]: /: 118.2 MiB (123887616 bytes) trimmed on /dev/mapper/newpc-root
Oct 26 21:00:56 newpc systemd[1]: fstrim.service: Succeeded.
Oct 26 21:00:56 newpc systemd[1]: Started Discard unused blocks on filesystems from /etc/fstab.
Вот не пойму, зачем мейнтейнеры дистра так сделали, учитывая что arch это десктопный дистрибутив и у большинства основную часть диска занимает как правило именно home