[SOLVED] fstrim.service failure
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Re: fstrim.service failure
Did you enable optimization on Windows?
How did you disable it? I can run the TRIM test with it disabled and sharing an EFI. I will do a dual boot install offline and test TRIM.
How did you disable it? I can run the TRIM test with it disabled and sharing an EFI. I will do a dual boot install offline and test TRIM.
Re: fstrim.service failure
I disabled Windows optimization a few days ago after finding out about the bug where it can't remember when it last ran. I ran it once manually, but won't re-enable it until the bug is fixed.
Re: fstrim.service failure
I'm trying to duplicate your setup.I disabled Windows optimization
How did you disable Windows Optimization.
I can disable TRIM but apparently only for NTFS.
Re: fstrim.service failure
I believe it was in Programs --> Administrative Tools --> Disk Cleanup.
Re: fstrim.service failure
I disabled Optimization by going to Optimization and shut the schedule off.
So this is what happened:
I did an install as close to yours as possible. Win10 separate SSD, then installed Mint 20 Cinnamon with all partitions similar to yours on another SSD.
The end result is that it made no difference. Manual TRIM and Scheduled TRIM all "Finished" without errors. I'll post the scheduled TRIM only for you to see. I don't know why yours is broken.
Dual boot with Windows Optimization Scheduled disabled
So this is what happened:
I did an install as close to yours as possible. Win10 separate SSD, then installed Mint 20 Cinnamon with all partitions similar to yours on another SSD.
The end result is that it made no difference. Manual TRIM and Scheduled TRIM all "Finished" without errors. I'll post the scheduled TRIM only for you to see. I don't know why yours is broken.
Dual boot with Windows Optimization Scheduled disabled
Code: Select all
Sep 08 16:27:51 Dual systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Sep 08 16:28:21 Dual fstrim[845]: /mnt/MY-DATA: 13.7 GiB (14676901888 bytes) trimmed on /dev/sdb5
Sep 08 16:28:21 Dual fstrim[845]: /boot/efi: 63.3 MiB (66350080 bytes) trimmed on /dev/sda1
Sep 08 16:28:21 Dual fstrim[845]: /boot: 808.8 MiB (848023552 bytes) trimmed on /dev/sdb1
Sep 08 16:28:21 Dual fstrim[845]: /: 19.5 GiB (20913569792 bytes) trimmed on /dev/sdb3
Sep 08 16:28:21 Dual systemd[1]: fstrim.service: Succeeded.
Sep 08 16:28:21 Dual systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
Re: fstrim.service failure
I really appreciate the time/effort you've put into this; just wish we could get past it. If it ends up being hardware-related, then there's no way you can do anything more.
Re: fstrim.service failure
I don't mind. I use ICY-Dock and have a lot of old beater SSD. Afterwards, I just erase them. I use Foxclone or Clonezilla to clone them from images I've made. Here's something you can try:
Wait for drive to quit blinking, then:
See if any errors are reported and fixed.
Code: Select all
sudo btrfs scrub start /
Code: Select all
sudo btrfs scrub status /
Last edited by LanceM on Wed Sep 02, 2020 7:07 pm, edited 1 time in total.
Re: fstrim.service failure
(Minor typo in your 2nd command)
Code: Select all
$ sudo btrfs scrub status /
scrub status for ab3b3cfb-7957-4191-b65c-2074deafaa49
scrub started at Wed Sep 2 16:02:55 2020 and finished after 00:00:15
total bytes scrubbed: 7.83GiB with 0 errors
Re: fstrim.service failure
Thanks. I fixed the typo.
Last edited by LanceM on Thu Sep 03, 2020 10:34 pm, edited 1 time in total.
Re: fstrim.service failure
Automatic TRIM is not enabled by default on LMDE 4. I have it enabled. I checked the log on my laptop and the output is much like your Aug 24 and does not say "Finished"
It has not been started in a coouple weeks, so this is the scheduled TRIM output
I can try and duplicate this:
It has not been started in a coouple weeks, so this is the scheduled TRIM output
Code: Select all
Logs begin at Thu 2020-09-03 08:49:27 MDT, end at Thu 2020-09-03 09:48:18 MDT. --
Sep 03 08:49:30 de4 systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Sep 03 08:49:40 de4 fstrim[575]: /home: 17.3 GiB (18564419584 bytes) trimmed on /dev/mmcblk0p3
Sep 03 08:49:40 de4 fstrim[575]: /: 33.1 GiB (35574759424 bytes) trimmed on /dev/mmcblk0p2
Sep 03 08:49:40 de4 fstrim[575]: /boot/efi: 505.9 MiB (530448384 bytes) trimmed on /dev/mmcblk0p1
Sep 03 08:49:40 de4 systemd[1]: fstrim.service: Succeeded.
Sep 03 08:49:40 de4 systemd[1]: Started Discard unused blocks on filesystems from /etc/fstab.
if you tell me how.One thing that may or not matter is my custom backup program. Daily, sometime between 8AM and 8PM, the backup runs. One of the first things it does is sync a few data directories from my Windows install and my /home directory (using unison). The Windows C-drive is mounted, synced, then unmounted.
Re: fstrim.service failure
One other thing I noticed, besides the journal output, is I have
1) Mount the Windows partition:
2) Next, run unison:
3) Unmount the Windows partition:
My unison prefs file looks like this:
noatime
on all my SSD partitions. Again, just throwing out something new. As far as the script goes, the section that syncs my Windows stuff is pretty simple (this is being done as root). If you want the exact Python function, let me know:1) Mount the Windows partition:
mount UUID=A4DC8D83DC8D508A -o uid=1000,gid=1000,umask=022,dmask=022 /media/Windows-C
2) Next, run unison:
su - my_username -c "unison"
3) Unmount the Windows partition:
sync; umount UUID=A4DC8D83DC8D508A
My unison prefs file looks like this:
Code: Select all
root = /home/my_username
root = /media/Windows-C/Users/ajgri
path = Downloads
path = Development
path = Music
path = Pictures
path = Saved Games
ignore = Name desktop.ini
ignore = Path */Linux
ignore = Path */projects/Linux
ignore = Path */venv
perms = 0
batch = true
Re: fstrim.service failure
I see if I can figure the sync out. As far as I know noatime is obsolete. I used to use it, but not anymore. After this post:
viewtopic.php?p=1492407#p1492407
viewtopic.php?p=1492407#p1492407
Re: fstrim.service failure
Too much trouble to figure the sync out. I guess you could disable it and see what happens next Monday.
Re: fstrim.service failure
The only reason I added the sync command was to make sure that all of the data was written to the Windows partition before I unmounted it. I only added noatime due to Pjotr's "Easy Linux Tips Project" recommendation.LanceM wrote: ⤴Thu Sep 03, 2020 12:57 pm I see if I can figure the sync out. As far as I know noatime is obsolete. I used to use it, but not anymore. After this post:
viewtopic.php?p=1492407#p1492407
Re: fstrim.service failure
I think you can remove it. If you do, remember to, afterwards, do
Code: Select all
sudo update-grub
Re: fstrim.service failure
On my test system I added noatime to etc/fstab, updated grub, rebooted and ran
TRIM still "Finished"
The etc/fstab edit looked like this
Code: Select all
sudo systemctl start fstrim
The etc/fstab edit looked like this
Code: Select all
btrfs defaults,subvol=@,noatime 0
Re: fstrim.service failure
The only difference on my fstab is I have noatime before defaults. It must be a one-off bug; I'm getting nowhere on the 'net and my StackExchange question hasn't even gotten a comment yet. Maybe this will all go away once I make the switch to LM20.
Re: fstrim.service failure
That noatime configuration came from Tony George. I sent him an email about it, and how to configure it for Btrfs. Back when I was testing writes to SSDs for noatime. It made no difference to writes. It doesn't on Ext4 either, at least not on systems I tested. It's obsolete for that, I think due to relatime.
Re: fstrim.service failure
I decided to revisit this thread, and I'm finally getting the desired output from the fstrim.service:
I recently reinstalled my dual-boot and went with Mint 20, which I'm almost certain is why this is working now.
Code: Select all
$ journalctl -u fstrim.service
-- Logs begin at Fri 2020-10-30 10:18:45 PDT, end at Tue 2020-11-10 15:17:13 PST. --
Nov 02 00:00:06 dss-mint systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Nov 02 00:01:06 dss-mint fstrim[16832]: /media/Backup-Data: 729.5 GiB (783283601408 bytes) trimmed on /dev/sdb5
Nov 02 00:01:06 dss-mint fstrim[16832]: /boot/efi: 63.2 MiB (66308096 bytes) trimmed on /dev/sda1
Nov 02 00:01:06 dss-mint fstrim[16832]: /boot: 739.4 MiB (775307264 bytes) trimmed on /dev/sdb1
Nov 02 00:01:06 dss-mint fstrim[16832]: /: 62.5 GiB (67139670016 bytes) trimmed on /dev/sdb3
Nov 02 00:01:06 dss-mint systemd[1]: fstrim.service: Succeeded.
Nov 02 00:01:06 dss-mint systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
-- Reboot --
Nov 09 00:00:30 dss-mint systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Nov 09 00:01:41 dss-mint fstrim[31881]: /media/Backup-Data: 694.4 GiB (745545981952 bytes) trimmed on /dev/sdb5
Nov 09 00:01:41 dss-mint fstrim[31881]: /boot/efi: 63.2 MiB (66308096 bytes) trimmed on /dev/sda1
Nov 09 00:01:41 dss-mint fstrim[31881]: /boot: 738.4 MiB (774217728 bytes) trimmed on /dev/sdb1
Nov 09 00:01:41 dss-mint fstrim[31881]: /: 50.7 GiB (54389039104 bytes) trimmed on /dev/sdb3
Nov 09 00:01:41 dss-mint systemd[1]: fstrim.service: Succeeded.
Nov 09 00:01:41 dss-mint systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.