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 hvfDRVIwwlxZ for ; Thu, 25 Oct 2012 17:20:55 +0200 (CEST) Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com [209.85.215.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.saout.de (Postfix) with ESMTPS for ; Thu, 25 Oct 2012 17:20:54 +0200 (CEST) Received: by mail-ea0-f178.google.com with SMTP id d13so660246eaa.37 for ; Thu, 25 Oct 2012 08:20:54 -0700 (PDT) Message-ID: <508958CA.800@gmail.com> Date: Thu, 25 Oct 2012 17:20:42 +0200 From: Milan Broz MIME-Version: 1.0 References: <50862339.6060201@dennis.birkholz.biz> <5089114B.8050106@gmail.com> <508951B8.9050300@dennis.birkholz.biz> In-Reply-To: <508951B8.9050300@dennis.birkholz.biz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] Toggle read-only status of mapping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dennis Birkholz Cc: dm-crypt@saout.de On 10/25/2012 04:50 PM, Dennis Birkholz wrote: > Am 25.10.2012 12:15, schrieb Milan Broz: > The reason is relatively easy: if my raid is read-only, it can crash and > I can reassemble it without a problem, but I cannot make it read-only if > the crypt-mapping is read-write. If you raid is mapped read-write, and there is a device failure, it either continue to be read-write (in degraded mode, that's exactly what "redundant" in RAID means) or the array is lost completely (then you must deactivate mapped device anyway). And raid allows resync while read-write so I really do not see real use for this switch. (And even read-only fs mount sometime means filesystem journal reply, specifically after fs crash.) Anyway, it is easily to be done with dmsetup: NAME= # load identical but read-only table into inactive slot dmsetup reload $NAME --readonly --table "$(dmsetup table --showkeys $NAME)" # switch tables dmsetup resume $NAME Milan