You are not logged in.
Pages: 1
I want to use periodic TRIM in a dm-crypt + luks system.
My SSD supports TRIM:
[root@archzenbook]# lsblk -D
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda 0 512B 2G 0
├─sda1 0 512B 2G 0
└─sda2 0 512B 2G 0
└─luks-92797f9d-9c23-4ea4-a1db-5adad0658cd1 0 512B 2G 0I thought I'd stay away from Continuous TRIM as I don't know how good my SSD's BIOS is at doing that. But I would like to get Periodic TRIM working so I enabled the fstrim.timer:
[root@archzenbook]# systemctl enable fstrim.timer
Created symlink /etc/systemd/system/timers.target.wants/fstrim.timer → /usr/lib/systemd/system/fstrim.timer.But reading this section in the wiki about dm-crypt and TRIM made me confused. Do I need to do something more to get periodic trim working?
Is there a way to tell if periodic trim was successful after it has run?
Last edited by tnek (2017-05-05 11:29:17)
Offline
Which part of the dm-crypt trim article that you linked to don't you understand?
It clearly tells you what extra steps need to be taken.
Offline
LUKS needs allow discard flag to be set.
You can check with dmsetup table
yourluks: 0 9999 crypt aes-xts-plain64 0000 0 0:0 4096 1 allow_discards
^^^^^^^^^^^^^^or the more generic yes-trim-test https://unix.stackexchange.com/a/85880/30851
Offline
Which part of the dm-crypt trim article that you linked to don't you understand?
It clearly tells you what extra steps need to be taken.
Yes, when I looked at it now with rested eyes I wouldn't improve it. It's clear enough as it is.
LUKS needs allow discard flag to be set.
You can check with dmsetup table
yourluks: 0 9999 crypt aes-xts-plain64 0000 0 0:0 4096 1 allow_discards ^^^^^^^^^^^^^^or the more generic yes-trim-test https://unix.stackexchange.com/a/85880/30851
I added the discard option to my systemd-boot entry:
echo "options luks.options=discard" >>/boot/loader/entries/arch.confRebooted and could verify that it worked
[root@archzenbook]# dmsetup table
luks-92797f9d-9c23-4ea4-a1db-5adad0658cd1: 0 499063439 crypt aes-xts-plain64 0000000000000000000000000000000000000000000000000000000000000000 0 8:2 4096 1 allow_discardsThe verification part was not in (that part at least) of the wiki so it was of great value! Thanks!
Offline
Pages: 1