Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UMjAIM8jn5cq for ; Mon, 18 Jul 2011 10:45:32 +0200 (CEST) Received: from mx.mylinuxtime.de (mx.mylinuxtime.de [IPv6:2a01:138:b005:1::a05:1d1]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Mon, 18 Jul 2011 10:45:31 +0200 (CEST) Date: Mon, 18 Jul 2011 10:45:29 +0200 From: Christian Hesse Message-ID: <20110718104529.60408311@leda.vpn.lugor.de> In-Reply-To: <4E205321.20701@redhat.com> References: <20110711231732.596b8622.ldarby@tuffmail.com> <20110712124717.GC31326@tansi.org> <20110714110425.GB13900@tansi.org> <20110714133533.GA19714@tansi.org> <4E1EF95D.40406@web.de> <4E1F014E.40508@andregall.de> <4E1F116D.50402@redhat.com> <20110715155908.3e08b9ec@io.vpn.lugor.de> <4E205321.20701@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] Status of trim for SSds? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Milan Broz Cc: dm-crypt@saout.de Milan Broz on Fri, 15 Jul 2011 16:48:01 +0200: > On 07/15/2011 03:59 PM, Christian Hesse wrote: > > Ok, I do have a kernel with discard on dm-crypt support now. How do I > > set this option allow_discards for my device using dmsetup? dmsetup's > > manpage does not tell anything about it. > > Backup your data, really. Note there could be still bugs. I do have good backup. Really. ;) > You have to manually reload table with discard enabled for now, > it is quite complicated and dangerous because you will manipulate with > master key string directly: > > 1) Activate device using cryptsetup, remember active table for your device, > including key: > > # dmsetup table --showkeys > > table will look like "0 1234 crypt aes-xts-plain64 0 8:2 8192" > (with different parameters according to your device, > do not forget --showkeys option) > > 2) Reload table with discard enabled, (add " 1 allow_discards" > to the end of table line) > > # dmsetup load --" 1 allow_discards" > > 3) activate new table > > # dmsetup resume > > (check that dmsetup table again - it should print discard support now) > > Alternatively, you can activate table directly (instead of cryptsetup) > > # dmsetup create --table " 1 allow_discards") > > If you do not understand what are you doing here, please _wait_ until there > is official userspace support. > > Any mistake here will cause data corruption or complete data loss! If I understand correctly the table reload suspends my device? With the root partition inside the crypt device I would have to do this in initram disk I think... Perhaps I really should wait for support in cryptsetup. :D However... Thanks a lot for your work and the quick response! -- Schoene Gruesse Chris