Results 1 to 4 of 4

Thread: Should I enable/start fstrim service ?

  1. #1

    Default Should I enable/start fstrim service ?

    Hi there,

    My system has a SSD as primary disk.
    I notice that the service fstrim in Services Manager is disabled/inactive.
    Should I enable/activate it ?

    I've heard that is managed by the kernel and also, the new devices do an auto-trim internally, no need external tools. I'm not sure how to proceed.

    I appreciate any comments,

  2. #2
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    2,215

    Default Re: Should I enable/start fstrim service ?

    If you have an SSD the installer should have configured fstrim.timer to trigger the fstrim.service every week or so.
    As an example, this is what I see for the last few days:
    Code:
    localhost:~ # journalctl |grep fstrim
    <snip>
    May 29 15:03:38 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    May 29 20:06:42 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    May 30 15:56:56 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    May 30 16:43:17 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    May 30 19:44:54 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    May 30 22:11:45 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    May 31 11:04:28 localhost.localdomain fstrim[4352]: /boot/efi: 169.5 MiB (177774592 bytes) trimmed on /dev/sda1 
    May 31 11:04:28 localhost.localdomain fstrim[4352]: /home: 7.2 GiB (7679602688 bytes) trimmed on /dev/sda2 
    May 31 11:04:28 localhost.localdomain fstrim[4352]: /: 16.9 GiB (18136068096 bytes) trimmed on /dev/sda3 
    May 31 11:04:28 localhost.localdomain systemd[1]: fstrim.service: Succeeded. 
    May 31 11:44:57 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    May 31 19:02:51 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    Jun 01 12:26:05 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    Jun 01 20:25:54 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    Jun 01 20:49:02 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    Jun 01 23:17:50 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    Jun 02 14:20:27 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    Jun 02 15:09:41 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    localhost:~ #
    So IMHO you have nothing to do.
    Tumbleweed Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.3

  3. #3

    Default Re: Should I enable/start fstrim service ?

    Quote Originally Posted by OrsoBruno View Post
    If you have an SSD the installer should have configured fstrim.timer to trigger the fstrim.service every week or so.
    As an example, this is what I see for the last few days:
    Code:
    localhost:~ # journalctl |grep fstrim
    <snip>
    May 29 15:03:38 localhost.localdomain systemd[1]: fstrim.timer: Succeeded. 
    ...
    localhost:~ #
    So IMHO you have nothing to do.
    Mine shows the same as yours.
    Digging a bit more,
    Code:
    systemctl status fstrim
    ● fstrim.service - Discard unused blocks on filesystems from /etc/fstab
         Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static)
         Active: inactive (dead)
    TriggeredBy:  fstrim.timer
           Docs: man:fstrim(8)
    
    
    I notice that fstrim.service is a secondary service triggered by fstrim.timer. So, you are right. Nothing to do ! Nice !

    thank you !

  4. #4
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,361

    Default Re: Should I enable/start fstrim service ?

    Quote Originally Posted by marozsas View Post
    fstrim.service is a secondary service triggered by fstrim.timer.
    If you look at the systemd status of the Timer service, you'll see the Timer's next expiry time – the point in time when the fstrim service will be triggered to execute …

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •