From mboxrd@z Thu Jan 1 00:00:00 1970 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 pbQQ-pKsUvcl for ; Fri, 15 Jul 2011 16:48:04 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mail.saout.de (Postfix) with ESMTP for ; Fri, 15 Jul 2011 16:48:04 +0200 (CEST) Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6FEm3Sg002546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Jul 2011 10:48:03 -0400 Received: from [10.34.26.53] (tawny.brq.redhat.com [10.34.26.53]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6FEm2Ic001798 for ; Fri, 15 Jul 2011 10:48:02 -0400 Message-ID: <4E205321.20701@redhat.com> Date: Fri, 15 Jul 2011 16:48:01 +0200 From: Milan Broz MIME-Version: 1.0 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> In-Reply-To: <20110715155908.3e08b9ec@io.vpn.lugor.de> Content-Type: text/plain; charset=ISO-8859-1 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: dm-crypt@saout.de 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. 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! Milan