You are not logged in.

#1 2016-01-17 21:22:13

Radioactiveman
Member
From: Germany
Registered: 2010-05-13
Posts: 389

fstrim creates no log entries

I have a Crucial M4 SSD which supports TRIM. To make use of it I enabled the fstrim timer as written in the Arch Linux wiki.
However "journalctl -u fstrim" shows no log entries although I enabled the timer several weeks/months ago. This is confusing me, is this a usual behavior? Is TRIM working as intended anyway?

The important command output:

# hdparm -I /dev/sda | grep TRIM
	   *	Data Set Management TRIM supported (limit 8 blocks)
	   *	Deterministic read data after TRIM
# journalctl -u fstrim
-- No entries --
# 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 So 2016-01-17 18:18:01 CET; 3h 56min ago
     Docs: man:fstrim

Offline

#2 2016-01-17 21:49:35

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: fstrim creates no log entries

I wonder if you need to at least start fstrim.service ONCE for the timer to work.

Btw this is a more accurate way to tell whether fstrim can TRIM your drive:

[tom@localhost ~]$ grep . /sys/block/sd*/queue/discard_*
/sys/block/sda/queue/discard_granularity:0
/sys/block/sda/queue/discard_max_bytes:0
/sys/block/sda/queue/discard_max_hw_bytes:0
/sys/block/sda/queue/discard_zeroes_data:0
/sys/block/sdb/queue/discard_granularity:512
/sys/block/sdb/queue/discard_max_bytes:2147450880
/sys/block/sdb/queue/discard_max_hw_bytes:2147450880
/sys/block/sdb/queue/discard_zeroes_data:0
[tom@localhost ~]$ 

(Obviously,) sda is a no and sdb is a yes.

Last edited by tom.ty89 (2016-01-17 22:30:48)

Offline

#3 2016-01-17 22:05:03

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: fstrim creates no log entries

I think you have to set your journal storage to "persistent" or create /var/log/journal to keep log entries for your timer.

See journald.conf(5)


Jin, Jîyan, Azadî

Offline

#4 2016-01-17 22:09:45

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: fstrim creates no log entries

journald.conf(5) wrote:

..."auto" is similar to "persistent" but the directory /var/log/journal is not created if needed,...

[tom@localhost ~]$ pacman -Qo /var/log/journal/
/var/log/journal/ is owned by systemd 228-3

Offline

#5 2016-01-18 18:00:00

Radioactiveman
Member
From: Germany
Registered: 2010-05-13
Posts: 389

Re: fstrim creates no log entries

"/var/log/journal/" already exists and is owned by systemd, as tom.ty89 wrote. And the SSD supports TRIM definitely.

$ grep . /sys/block/sda/queue/discard_*
/sys/block/sda/queue/discard_granularity:512
/sys/block/sda/queue/discard_max_bytes:2147450880
/sys/block/sda/queue/discard_max_hw_bytes:2147450880
/sys/block/sda/queue/discard_zeroes_data:0

What is the output of "journalctl -u fstrim" for other SSD users?

Offline

#6 2016-01-18 18:10:48

ronw
Member
Registered: 2013-07-02
Posts: 59

Re: fstrim creates no log entries

$ journalctl -u fstrim
-- Logs begin at Wed 2016-01-13 09:05:50 EST, end at Mon 2016-01-18 12:53:13 EST. --
Jan 18 00:00:35 gazp6 systemd[1]: Starting Discard unused blocks...
Jan 18 00:00:37 gazp6 systemd[1]: Started Discard unused blocks.

Offline

#7 2016-01-18 18:51:00

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: fstrim creates no log entries

$ journalctl -u fstrim
-- Logs begin at vr 2015-11-20 20:55:09 CET, end at ma 2016-01-18 19:49:36 CET. --
nov 30 10:30:12 desktop1 systemd[1]: Starting Discard unused blocks...
nov 30 10:30:23 desktop1 systemd[1]: Started Discard unused blocks.
-- Reboot --
dec 07 09:28:39 desktop1 systemd[1]: Starting Discard unused blocks...
dec 07 09:28:50 desktop1 systemd[1]: Started Discard unused blocks.
-- Reboot --
dec 14 11:54:16 desktop1 systemd[1]: Starting Discard unused blocks...
dec 14 11:54:25 desktop1 systemd[1]: Started Discard unused blocks.
-- Reboot --
dec 21 10:44:14 desktop1 systemd[1]: Starting Discard unused blocks...
dec 21 10:44:23 desktop1 systemd[1]: Started Discard unused blocks.
-- Reboot --
dec 28 11:56:06 desktop1 systemd[1]: Starting Discard unused blocks...
dec 28 11:56:15 desktop1 systemd[1]: Started Discard unused blocks.
-- Reboot --
jan 04 13:50:10 desktop1 systemd[1]: Starting Discard unused blocks...
jan 04 13:50:18 desktop1 systemd[1]: Started Discard unused blocks.
-- Reboot --
jan 11 13:45:10 desktop1 systemd[1]: Starting Discard unused blocks...
jan 11 13:45:18 desktop1 systemd[1]: Started Discard unused blocks.
-- Reboot --
jan 18 10:14:28 desktop1 systemd[1]: Starting Discard unused blocks...
jan 18 10:14:39 desktop1 systemd[1]: Started Discard unused blocks.

As you can see, it runs every week so far.

Offline

Board footer

Powered by FluxBB