From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (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 ; Sat, 9 May 2020 21:42:03 +0200 (CEST) Received: by mail-ej1-x643.google.com with SMTP id z5so3492382ejb.3 for ; Sat, 09 May 2020 12:42:03 -0700 (PDT) Date: Sat, 9 May 2020 21:41:59 +0200 From: Nikolay Kichukov Message-ID: <20200509214159.3d85409c@glena.fritz.box> In-Reply-To: References: <20200509162535.13a4086e@glena.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] luks2 and discard/trim not working List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Murphy Cc: dm-crypt@saout.de Hello Chris, On Sat, 9 May 2020 09:45:13 -0600 Chris Murphy wrote: > On Sat, May 9, 2020 at 8:28 AM Nikolay Kichukov > wrote: > > > > 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. > > ... > > > 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 > > Was the original luksFormat command combined with --integrity option? yes > From man cryptsetup: Since dm-integrity doesn't support discards > (TRIM), dm-crypt device on top of it inherits this, so integrity > protection mode doesn't support discards either. Thanks for the direction! It seems like, this is in the pipeline for dm-integrity, which is to arrive in version 1.6.0 in kernel 5.7: "allow_discards Allow block discard requests (a.k.a. TRIM) for the integrity device. Discards are only allowed to devices using internal hash. The default is to ignore discard requests. Available since: 1.6.0 (kernel 5.7)" source: https://gitlab.com/cryptsetup/cryptsetup/-/wikis/DMIntegrity Does mine use an internal hash? Thanks, -Nik