• is fstrim really working?


    Re: trim for ssd

    I had the same question as the original poster of above mentioned question, and it is marked solved, but in my case the results are different, and therefore unresolved for me. I have 3 SSD’s, and all three do support TRIM, and the system does recognize that.

    1. @joekamprad suggests to run:
    cat /var/lib/systemd/timers/stamp-fstrim.timer
    

    but no such file or directory exists. tying the next suggestion to check for the service:

    systemctl status fstrim.timer
    

    does give a result, but shows the path as: /usr/lib/systemd/system/fstrim.timer

    So there is a discrepancy, and running: cat /usr/lib/systemd/system/fstrim.timer works, and shows the files content:

    [Unit]
    Description=Discard unused blocks once a week
    Documentation=man:fstrim

    [Timer]
    OnCalendar=weekly
    AccuracySec=1h
    Persistent=true

    [Install]
    WantedBy=timers.target.

    1. The expected output of:
    systemctl status fstrim.timer
    

    is different on my system as the one in the original “solved” question:

    ● 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
         Docs: man:fstrim
    

    leading me to believe that something is not working right, as Active: “inactive (dead)” would suggest. Sadly no telling information is given as to what is going wrong, where it’s failing…

    Also: Having read in several doc’s on several forums and in many articles that using the “discard” option in fstab is not recommended for good reason, and given that a weekly TRIM operation is set as a default in either Arch or Antergos, it begs to question why the fstab method is set when installing Antergos.

    The flazzum you spizz, the zoider you splat!

  • @Zoidmo said in is fstrim really working?:

    @joekamprad suggests to run:

    seems i do not try that command this time :bomb: i just copy it from ArchWiki…

    But good that you find the right path!

    ╰─➤  systemctl status fstrim.timer
    ● fstrim.timer - Discard unused blocks once a week
       Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: disabled)
       Active: active (waiting) since Thu 2017-08-24 21:14:27 CEST; 35min ago
      Trigger: Mon 2017-08-28 00:00:00 CEST; 3 days left
         Docs: man:fstrim
    
    Aug 24 21:14:27 empowered64 systemd[1]: Started Discard unused blocks once a week.
    
    

    here…

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • Running “systemctl status fstrim.timer” gave me the path, but as you can see my output is different from yours. Yours is “active and waiting”, mine is “inactive and dead”! Now I need to find out why, and what to do about it.

    I can see that yours has a trigger:

    Trigger: Mon 2017-08-28 00:00:00 CEST; 3 days left

    Mine doesn’t:

    Trigger: n/a

    n/a stands for “not applicable”, so that is wrong in and of itself, as it needs a trigger to be launched. “not set” would be more appropriate. An answer to why it is not set, and where I can set it, along with where the failure is would help.

    I was going to add a script to /etc/cron.weekly as suggested by a few articles, but as usual, when following instructions in Linuxland, two days after someone posts a “How To” the whole arrangement of the file system changes, as well as the entire procedure!

    The flazzum you spizz, the zoider you splat!

  • So you have them both enabled? systemd timer and cronjob?

    you can take a look inside journal to see what went wrong:

    journalctl -b -0 | curl -F [email protected] https://ptpb.pw/?u=1
    

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • To your first question: I don’t know. I know that both should be enabled by default to run system jobs, and I also know that I didn’t disable them.

    Looking inside the journal seems to require much more extensive knowledge of Linux, than I have. I get the hardware related data and see a few things I recognize, but the rest is gibberish.

    The flazzum you spizz, the zoider you splat!

  • The task scheduler in system settings has two options to show cron jobs, personal and system. Both are completely empty. But knowing KDE, it doesn’t mean there are none, just that it is only for adding cron jobs of my own, not for viewing those included in the distro.

    The flazzum you spizz, the zoider you splat!

  • If you give the journal link I can have a look.

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • Thats very nice of you!

    https://ptpb.pw/GIq3

    The flazzum you spizz, the zoider you splat!

  • Oh, and since I did not realize that it gave me an output (did not expect a link to the internet) I tried the same with sudo, and got another link. Possibly containing more info: https://ptpb.pw/Wzo_

    The flazzum you spizz, the zoider you splat!

  • nothing failed for fstrim.timer inside the journal… but as i can see it does not log into journal at all…

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • I have been going through it myself, and trying to make sense of it all, but it looks like KDE/plasma stuff shows the most errors. You would have to be commander Data from Star Treck to understand it!

    So, do you know how to make it log into the journal? If I understand correctly it didn’t even try, otherwise there would be some indication that it at least tried, and failed for some reason.

    The flazzum you spizz, the zoider you splat!

  • On my system it logs if it trim, but also nothing else.
    It should log somewhere else…

    journalctl -u  fstrim.service
    
    systemctl list-units -t service --all | grep fstrim 
    

    systemd is nice but a big monster…

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • no log entries and no listings = No answers! :confused:

    If my SSD’s never get trimmed, they will get fat and explode!

    The flazzum you spizz, the zoider you splat!

  • what if you stop and start the service?

    sudo systemctl stop fstrim.timer
    sudo systemctl start fstrim.timer
    

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • Did that, but no output after either command. so no way of telling if it started the service.

    The flazzum you spizz, the zoider you splat!

  • @joekamprad said in is fstrim really working?:
    see if sudo systemctl status fstrim.timer has changed

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • Looking in background services (system settings - startup and shutdown) there is no fstrim, cron, cronie nor anacron.

    The flazzum you spizz, the zoider you splat!

  • this logs something to my journal:

    Aug 25 02:28:05 empowered64 sudo[4099]: killajoe : TTY=pts/0 ; PWD=/home/killajoe ; USER=root ; COMMAND=/usr/bin/systemctl stop fstrim.timer
    Aug 25 02:28:05 empowered64 sudo[4099]: pam_unix(sudo:session): session opened for user root by (uid=0)
    Aug 25 02:28:05 empowered64 systemd[1]: Stopped Discard unused blocks once a week.
    Aug 25 02:28:05 empowered64 sudo[4099]: pam_unix(sudo:session): session closed for user root
    Aug 25 02:28:10 empowered64 sudo[4199]: killajoe : TTY=pts/0 ; PWD=/home/killajoe ; USER=root ; COMMAND=/usr/bin/systemctl start fstrim.timer
    Aug 25 02:28:10 empowered64 sudo[4199]: pam_unix(sudo:session): session opened for user root by (uid=0)
    Aug 25 02:28:10 empowered64 systemd[1]: Started Discard unused blocks once a week.
    Aug 25 02:28:10 empowered64 sudo[4199]: pam_unix(sudo:session): session closed for user root
    

    [updates once a week] = [90% less problems]
    [Li{u}n//u//{i}x] since 1988 - overcoming failure means success
    howto-install-antergos
    how to add system logs
    i3 GNOME

  • BINGO!!!

    ● fstrim.timer - Discard unused blocks once a week
       Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: disabled)
       Active: active (waiting) since Thu 2017-08-24 20:24:26 EDT; 5min ago
      Trigger: Mon 2017-08-28 00:00:00 EDT; 3 days left
         Docs: man:fstrim
    
    Aug 24 20:24:26 RACER systemd[1]: Started Discard unused blocks once a week.
    

    Looks like it needed to be manually started for the first time (very strange indeed). Which makes me wonder what all else needs to be started first to get it to do what it’s supposed to!!! I also hope that it persists and actually does the job weekly. I also have to schedule backups…

    Looking at the portion of the log from your system: It’s “empowered” mine is not!!!
    Also: I think it has an assassin out for you (Killajoe)! To quote Elmer Fudd: " be vewy vewy cawefull!

    I may want to wait a week before I mark this as solved. Thanks for the good work detective Joe!

    The flazzum you spizz, the zoider you splat!

  • Also any insight to what the failure is all about, by someone who understands this stuff would be of great help. Something tells me that there may be other problems linked to this snafoo.

    The flazzum you spizz, the zoider you splat!

fstrim1 Posts 44Views 984
Log in to reply