* [dm-crypt] Toggle read-only status of mapping
@ 2012-10-23 4:55 Dennis Birkholz
2012-10-25 10:15 ` Milan Broz
0 siblings, 1 reply; 5+ messages in thread
From: Dennis Birkholz @ 2012-10-23 4:55 UTC (permalink / raw)
To: dm-crypt
Hello together,
currently it is possible to create a read-only mapping, but to me it
seems not possible to switch a rw mapping to a ro mapping or vice versa.
I use Software-RAID5->Luks->Ext4, do switch everything to read-only I
have to unmount, remove crypt mapping, create ro crypt mapping, mount
ro, switch raid to ro but it would be very nice if I only can switch
everything to ro.
Greets,
Dennis
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] Toggle read-only status of mapping
2012-10-23 4:55 [dm-crypt] Toggle read-only status of mapping Dennis Birkholz
@ 2012-10-25 10:15 ` Milan Broz
2012-10-25 14:50 ` Dennis Birkholz
0 siblings, 1 reply; 5+ messages in thread
From: Milan Broz @ 2012-10-25 10:15 UTC (permalink / raw)
To: Dennis Birkholz; +Cc: dm-crypt
On 10/23/2012 06:55 AM, Dennis Birkholz wrote:
> currently it is possible to create a read-only mapping, but to me it
> seems not possible to switch a rw mapping to a ro mapping or vice versa.
> I use Software-RAID5->Luks->Ext4, do switch everything to read-only I
> have to unmount, remove crypt mapping, create ro crypt mapping, mount
> ro, switch raid to ro but it would be very nice if I only can switch
> everything to ro.
Hm. What is the reason for this exercise?
Switching to read only of top layer is not enough?
Anyway, I think we can add this option to "resize" command perhaps.
(Resize reloads mapping, so it can switch read-only flag as well.)
But it can be dangerous in some situations...
(And you can do it already using dmsetup but that's quite complicated.)
Milan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] Toggle read-only status of mapping
2012-10-25 10:15 ` Milan Broz
@ 2012-10-25 14:50 ` Dennis Birkholz
2012-10-25 15:20 ` Milan Broz
0 siblings, 1 reply; 5+ messages in thread
From: Dennis Birkholz @ 2012-10-25 14:50 UTC (permalink / raw)
To: dm-crypt
Am 25.10.2012 12:15, schrieb Milan Broz:
> On 10/23/2012 06:55 AM, Dennis Birkholz wrote:
>> currently it is possible to create a read-only mapping, but to me it
>> seems not possible to switch a rw mapping to a ro mapping or vice versa.
>> I use Software-RAID5->Luks->Ext4, do switch everything to read-only I
>> have to unmount, remove crypt mapping, create ro crypt mapping, mount
>> ro, switch raid to ro but it would be very nice if I only can switch
>> everything to ro.
>
> Hm. What is the reason for this exercise?
> Switching to read only of top layer is not enough?
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.
> Anyway, I think we can add this option to "resize" command perhaps.
> (Resize reloads mapping, so it can switch read-only flag as well.)
That would be nice.
> But it can be dangerous in some situations...
> (And you can do it already using dmsetup but that's quite complicated.)
I will have a look into it.
Greets,
Dennis
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] Toggle read-only status of mapping
2012-10-25 14:50 ` Dennis Birkholz
@ 2012-10-25 15:20 ` Milan Broz
2012-10-25 17:10 ` Dennis Birkholz
0 siblings, 1 reply; 5+ messages in thread
From: Milan Broz @ 2012-10-25 15:20 UTC (permalink / raw)
To: Dennis Birkholz; +Cc: dm-crypt
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=<your crypt device 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] Toggle read-only status of mapping
2012-10-25 15:20 ` Milan Broz
@ 2012-10-25 17:10 ` Dennis Birkholz
0 siblings, 0 replies; 5+ messages in thread
From: Dennis Birkholz @ 2012-10-25 17:10 UTC (permalink / raw)
To: dm-crypt
Am 25.10.2012 17:20, schrieb Milan Broz:
> 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.)
I know how this works, just to wrap it up:
I have a RAID5 with 5 devices that are in a e-sata box where the e-sata
connection seems to be quite fragile: sometimes the port-multiplier in
the box starts to make problems and than one device after another drops
away. If my raid is read-write, the devices are marked unclean if they
drop out, if the raid is read-only, the devices are not marked unclean.
The contents of the raid is quite static so I only change something
every few days. If I just can change everything to rw before putting
something on the raid and switch it back to ro afterwards would be
really nice (and yes, I know of raid bitmap and I am going to change the
fragile e-sata box anyway in the future). Assembling the raid again
after it crashed and I restarted the e-sata box is the real problem here...
> Anyway, it is easily to be done with dmsetup:
>
> NAME=<your crypt device name>
>
> # load identical but read-only table into inactive slot
> dmsetup reload $NAME --readonly --table "$(dmsetup table --showkeys $NAME)"
> # switch tables
> dmsetup resume $NAME
Thanks for the info!
Greets,
Dennis
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-10-25 17:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-23 4:55 [dm-crypt] Toggle read-only status of mapping Dennis Birkholz
2012-10-25 10:15 ` Milan Broz
2012-10-25 14:50 ` Dennis Birkholz
2012-10-25 15:20 ` Milan Broz
2012-10-25 17:10 ` Dennis Birkholz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.