It's a systemd timer included within Arch that runs fstrim every week.
and what does that achieve?
Can’t you set this up as a cronjob?
Specifically, it's in the util-linux package. On Gentoo at least.
The way I understand it, it’s an automated job that sends the “trim” command to SSDs to discard all the blocks that have been marked as unused by the filesystem. My knowledge is a little patchy so I’m probably missing some important details…
When you go to delete something on an SSD, it’s simply just marked as being deleted. The file still technically occupies space on the SSD and the SSD will never simply overwrite space that has a deleted file on it.
So… by enabling the service, systemd will automatically send the trim command that tells the SSD to empty out all the space occupied by files marked as deleted which allows the SSD to reuse said space.
So why not do something like
sudo crontab -e
And add
0 10 * * 1 root the funy command
Assuming your PC is always on at 10 am on mondays?
Doesn't btrfs do this already?
Yeah, it's unnecessary with btrfs on somewhat recent kernels since it now enables discard=async by default.
It is not necessary but still better to run both online discard and batched fstrim. from man:
Also, a device may ignore the TRIM command if the range is too small, so running a batch discard has a greater probability of actually discarding the blocks.
Thank you! Will do!
What if im not on systemd
Just run a cron job every week that runs fstrim
@Newchair@Devorlon
You will regret it because of compatibility lack and larger boot time
For me runit boots just as fast. Compatibility wise everything I use works just fine. Out of curiosity, what requires it to run besides gnome anyway? (I'm not a systemd hater I just use a distro I like that happens to not use systemd)
The what?
It's a systemd timer included within Arch that runs fstrim every week.
and what does that achieve?
Can’t you set this up as a cronjob?
Specifically, it's in the util-linux package. On Gentoo at least.
The way I understand it, it’s an automated job that sends the “trim” command to SSDs to discard all the blocks that have been marked as unused by the filesystem. My knowledge is a little patchy so I’m probably missing some important details…
When you go to delete something on an SSD, it’s simply just marked as being deleted. The file still technically occupies space on the SSD and the SSD will never simply overwrite space that has a deleted file on it.
So… by enabling the service, systemd will automatically send the trim command that tells the SSD to empty out all the space occupied by files marked as deleted which allows the SSD to reuse said space.
So why not do something like
sudo crontab -e
And add
0 10 * * 1 root the funy command
Assuming your PC is always on at 10 am on mondays?