Blog

Ejecutando fstrim por primera vez

Ejecutando fstrim por primera vez

Tengo un par de SSDs sobre los que no había ejecutado TRIM nunca. No tengo habilitado continuous TRIM y el servicio fstrim.timer está desactivado por defecto:

j@furin ~ % sudo systemctl status fstrim.timer                                                                                  [0]
● fstrim.timer - Discard unused blocks once a week
     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: disabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● fstrim.service
       Docs: man:fstrim

Hoy he ejecutado fstrim por primera vez y…

j@furin ~ % sudo /usr/sbin/fstrim --fstab --verbose                                                          [0]
/mnt/hayai: 252 GiB (270566764544 bytes) trimmed on /dev/sdb1
/: 379.7 GiB (407734464512 bytes) trimmed on /dev/sda1

Curiosamente al ejecutarlo unos minutos después sigue borrando bastante:

j@furin ~ % sudo /usr/sbin/fstrim --fstab --verbose                                                                             [3]
/mnt/hayai: 1.3 GiB (1350897664 bytes) trimmed on /dev/sdb1
/: 1.8 GiB (1895231488 bytes) trimmed on /dev/sda1
j@furin ~ %                                                                                                                     [0]
j@furin ~ % sudo /usr/sbin/fstrim --fstab --verbose                                                                             [0]
/mnt/hayai: 1.2 GiB (1336463360 bytes) trimmed on /dev/sdb1
/: 1.8 GiB (1897439232 bytes) trimmed on /dev/sda1

Leyendo aquí parece que es por normal:

fstrim will report the same potential discard bytes  each  time,
              but  only sectors which had been written to between the discards
              would actually be discarded by the storage device.

man fstrim