Return-Path: Received: from mout.gmx.com (mout.gmx.com [74.208.4.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Mon, 17 Feb 2020 04:56:27 +0100 (CET) Received: from Phenom-II-x6.niklas.com ([71.208.70.57]) by mail.gmx.com (mrgmxus002 [74.208.5.15]) with ESMTPSA (Nemesis) id 0MNZDo-1j5CDK4390-007CY6 for ; Mon, 17 Feb 2020 04:56:25 +0100 Date: Sun, 16 Feb 2020 22:56:22 -0500 From: David Niklas Message-ID: <20200216225622.1330f0aa@Phenom-II-x6.niklas.com> In-Reply-To: <20200216135810.GA9235@citd.de> References: <20200215195941.7ef400b3@Phenom-II-x6.niklas.com> <20200216023203.GA8407@tansi.org> <20200216135810.GA9235@citd.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: Re: [dm-crypt] Streaming ciphers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de Yuck, top post. Reformat and reply. On Sun, 16 Feb 2020 14:58:10 +0100 Matthias Schniedermeyer wrote: > > On Sun, Feb 16, 2020 at 01:59:41 CET, David Niklas wrote: > > > Hello, > > > Today I was helping a poor luser who's Crucial P1 QLC SSD died from > > > too many writes. We still don't know what's doing the writing, but > > > he is running luks using FDE so write amplification is definitely a > > > factor. > > > I forget the answer to this so please enlighten me, is there a > > > streaming cypher he can use instead of a block cipher? A better > > > option that I didn't consider? > > > Not that the TCG Opal is to be fully trusted (nor is it available on > > > that model), but how does it work with respect to write > > > amplification vs. luks? > > > > > > Thanks, > > > David > On 16.02.2020 03:32, Arno Wagner wrote: > > Hi David, > > > > using LUKS should not result in write-amplification. > > LUKS uses 512B blocks and just provides an 1:1 mapping. > > Using defaults it does cause a higher write-amplification. > By default dm-crypt doesn't not enable discard-support, whereas it is > normaly supported for an unencrypted filesystem. > > And given that at least some distributions even install a > fstrim-cronjob, the filesystems are trimmed, even if not mounted with > the discard-option. > > This results in an unencrypted filesystem having it's empty space > "empty", as far as the SSD is concerned. > Wheras "empty" space (either "is" or "stays") "used" for a LUKS device. > > The "is" or "stays" difference comes with having the encrypted device > pre-inited or not. With pre-init the blocks are always "in use". > Without pre-init the blocks are "unused" as long as they aren't written > and switch to "in use" after first beeing written, after which they > will stay "in use" forever. > > Less "empty" space results in higher write-amplification because the > SSD has to remap "empty" space as it is "in use", as far as the SSD is > concerned. > > A pre-inited encrypted device, in this scenario, never has any empty > space. > > > I'm not saying that you can't make it equivalent, just that there are > differences when using the defaults. Thanks! I understand. Is there anything else I should be aware of (aside from a kernel option I need to look up again to delay writing to disk), that will lessen disk writes/amplification from luks? Thanks, David