TRIM (discard) over LUKS

TRIM (discard) over LUKS


  1. add discard option to fstab & crypttab

example:

fstab:

UUID=CB61-A03B                             /boot/efi              vfat   utf8                             0  2
UUID=a53c3f21-f2a9-42d9-a0e7-900afd768ca2 / btrfs compress=zstd,discard 0 0
UUID=a53c3f21-f2a9-42d9-a0e7-900afd768ca2 /.snapshots btrfs subvol=/@/.snapshots,discard 0 0
UUID=0ab82b55-f1cb-44b8-8409-02dc0770595c /home btrfs compress=zstd,discard 0 0
UUID=b6b8c46c-ac9d-4696-911d-29986a01bd66 /mnt/data btrfs compress=zstd 0 0
UUID=b6b8c46c-ac9d-4696-911d-29986a01bd66 /var/lib/docker/btrfs btrfs subvol=/docker/btrfs 0 0
192.168.200.12:/mnt/data /mnt/data nfs rw,noauto,users,_netdev 0 0

fat32 (in /boot/efi) does not support trim

crypttab:

cr_root  UUID=bfaf8b26-7ee5-48ab-abc9-4856dd77ab02  /main.key  x-initrd.attach,key-slot=1,discard
cr_home UUID=10f64de8-d76a-487b-ace2-26f1cbc27de4 /main.key x-initrd.attach,key-slot=1,discard

  1. rebuild initrd:

dracut -f

Содержание