[dm-crypt] luks container write-protected and read-only, can't be mounted

Milan Broz gmazyland at gmail.com
Wed May 2 12:46:00 CEST 2018


On 05/01/2018 04:17 PM, cici-tor wrote:
> Hello,
> 
> I hope you can help me.
> 
> I have a LUKS Container file called didi with files in it and mounted it (as didiOpen). While opening one file in the Container my Raspberry Pi crashed and made a reboot without closing and unmounting the Container.
> 
> Now I can open the Container but everytime when I want to mount the Container I get an Error, that the Container is read-only and cannot be mounted.
> 
> I use sudo mount -t ext4 /dev/mapper/didiOpen /mnt everytime.
> Error: 
> mount: /dev/mapper/didiOpen is write-protected, mounting read-only
> mount: cannot mount /dev/mapper/didiOpen read-only
> 
> When I check cryptsetup status OpenContainer it said:
> type:    LUKS1
>   cipher:  aes-xts-plain64
>   keysize: 512 bits
>   device:  /dev/loop0
>   loop:    /media/user/vid/didi
>   mode:    readonly
> 
> Closing and opening the Container does not help. There I get no Error, so opening/closing is not the problem, only the mounting of the opened container.
> 
> How can I get my write permissions back or copy all stuff without mounting in a new container?
> I've read luks write some special datas by closing the volume regulary? That is maybe the failure at the moment.

Some of your underlying storage layer is read-only (I guess it is underlying file).
Run "lsblk" and check "RO" flag (I guess /media/user/vid/didi does not have read-write access).

LUKS obviously cannot map read-write over read-only device. And it does not write any metadata on close/open.

Milan


More information about the dm-crypt mailing list