From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Fri, 8 May 2020 23:41:45 +0200 (CEST) Received: by mail-ed1-x533.google.com with SMTP id r7so2483992edo.11 for ; Fri, 08 May 2020 14:41:45 -0700 (PDT) Received: from glena.fritz.box (external.oldum.net. [82.161.240.76]) by smtp.googlemail.com with ESMTPSA id a9sm346514edv.49.2020.05.08.14.41.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 14:41:44 -0700 (PDT) Date: Fri, 8 May 2020 23:41:34 +0200 From: Nikolay Kichukov Message-ID: <20200508234134.7e4a4099@glena.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [dm-crypt] luks2 and discard/trim not working List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de Hello folks, Recently, I upgraded to LUKS2 on a NVME SSD disk and noticed that fstrim does not work. Surely it was running fine with LUKS1. Here are some more details: GNU/Gentoo Linux kernel: 5.5.13-gentoo-x86_64 sys-fs/cryptsetup-2.2.2 NVME supports discard and fstrim on filesystem on nvme0n1p2(without LUKS2 encyption) works fine: NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO nvme0n1 0 512B 2T 0 =E2=94=9C=E2=94=80nvme0n1p1 0 512B 2T 0 =E2=94=9C=E2=94=80nvme0n1p2 0 512B 2T 0 =E2=94=94=E2=94=80nvme0n1p3 0 512B 2T 0 =E2=94=94=E2=94=80root_dif 0 0B 0B 0 =E2=94=94=E2=94=80root 0 0B 0B 0 dmsetup table /dev/mapper/root | grep allow 0 947028136 crypt capi:rfc7539(chacha20,poly1305)-random :32:logon:cryptsetup:6ae40ec7-1b4c-40ea-871b-d13c9ae66b92-d0 0 254:0 0 2 allow_discards integrity:28:aead cryptsetup status root /dev/mapper/root is active and is in use. type: LUKS2 cipher: chacha20-random keysize: 256 bits key location: keyring integrity: poly1305 device: /dev/nvme0n1p3 sector size: 512 offset: 0 sectors size: 947028136 sectors mode: read/write flags: discards=20 However: fstrim -v / fstrim: /: the discard operation is not supported Any ideas? Thanks, -Nikolay