Re: Recover encrypted MD RAID1 member

Arno Wagner <[email protected]> Mon, 2 Dec 2024 17:02:07 +0100
Newsgroups dev.linux.lists.cryptsetup
Message-ID <Z03Z/[email protected]>
First, make an image-backup of sdd. It is far to easy to
mess things up when trying to recover.

Second, since this is RAID1, all you need to do is RAID 
recovery, LUKS is not involved.

Raid recovery is really simple here: Remove sdb, sde from the
computer, and start the array. mdadm will need some 
option to be willing to start a non-fresh array and degraded
array, probably someting like
  mdadm -A -R -f /dev/md0 /dev/sdd
or the like.

Fater that, your old LUKS container should behave as usual.

Regards,
Arno

On Mon, Dec 02, 2024 at 14:45:41 CET, Brian J. Murrell wrote:
> I was doing some maintenance of my RAID1 array and something seems to
> have gone sideways.  The array's structure looks like this:
> 
> sdb                                            8:16   0   3.7T  0 disk
> └─md0                                          9:0    0   3.7T  0 raid1
>   └─md0_encrypted                            253:39   0   3.7T  0 crypt
>     └─backups-backups                        253:40   0     3T  0 lvm 
> sdd                                            8:48   0   3.7T  0 disk
> └─md0                                          9:0    0   3.7T  0 raid1
>   └─md0_encrypted                            253:39   0   3.7T  0 crypt
>     └─backups-backups                        253:40   0     3T  0 lvm 
> sde                                            8:64   0   3.7T  0 disk
> └─md0                                          9:0    0   3.7T  0 raid1
>   └─md0_encrypted                            253:39   0   3.7T  0 crypt
>     └─backups-backups                        253:40   0     3T  0 lvm 
> 
> Except that sdd is not actually active in the array as in the failed
> state:
> 
> Personalities : [raid1] 
> md0 : active raid1 sdb[5] sde[3] sdd[4](F)
>       3906854744 blocks super 1.2 [3/2] [_UU]
>       bitmap: 14/15 pages [56KB], 131072KB chunk
> 
> unused devices: <none>
> 
> I think sdd was removed before things went sideways and so sdd might be
> my only good copy of the array.
> 
> The question is, how can I work with it independently of the array now?
> I'd like to get to the point of being able to check the content of
> backups-backups filesystem on that single disk, again, independently of
> the existing md0 array.
> 
> I know there is some crossover between LUKS and MD here, but I am
> suspecting that the LUKS part here is going to be the more complicated
> part and I am pretty green with regard to LUKS so hoping for some help
> in that regard.
> 
> Any help or suggestions would be much appreciated.
> 
> Cheers,
> b.
> 



-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: [email protected]
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier