All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wols Lists <antlists@youngman.org.uk>
To: Felix Koop <fdp@fkoop.de>, linux-raid@vger.kernel.org
Subject: Re: mdadm will only start root device degraded
Date: Fri, 11 Aug 2017 19:00:01 +0100	[thread overview]
Message-ID: <598DF0A1.5030902@youngman.org.uk> (raw)
In-Reply-To: <1502092265.23002.9.camel@fkoop.de>

On 07/08/17 08:51, Felix Koop wrote:
> Hello,
> 
> I have the following problem: /dev/md2 is my root device. This is a
> raid1 device consisting of 2 partitions (sdg1 and sdf1). Booting in
> this configuration worked fine.
> 
> When I decided to encrypt those partitions, I started to encrypt one of
> them (sdg1). Now the array always starts degraded with the encrypted
> sdg1 (cryptorootg) missing. I am asked during boot process for the
> password and the encrypted device is unlocked successfully. But the
> raid is not set up correctly. I have to run after every boot
> 
> mdadm /dev/md2 --add /dev/mapper/cryptorootg
> 
> and then device is sync'ing and working fine until next reboot. An
> entry in /etc/crypttab was created.
> 
> What do I have to configure differently to have mdadm recognising the
> raid device correctly during boot?
> 
> 
> 
Start again? I'm guessing md2 is a mirror, which means the raid code
expects sdg1 and sdf1 to be identical. But you've now encrypted one of
them, so they are not identical, which is why the raid keeps breaking on
boot.

I'm out of my depth here, but if you want to encrypt your raid, you need
to encrypt the raid device itself (md2), not the component devices.

(Or encrypt both component devices, such that your boot sequence will
need to unlock them before the raid can assemble them.)

Cheers,
Wol

  reply	other threads:[~2017-08-11 18:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07  7:51 mdadm will only start root device degraded Felix Koop
2017-08-11 18:00 ` Wols Lists [this message]
2017-08-12  9:20   ` Felix Koop
2017-08-12 14:17     ` Reindl Harald
2017-08-12 17:25     ` Anthony Youngman
2017-08-14  5:18       ` Felix Koop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=598DF0A1.5030902@youngman.org.uk \
    --to=antlists@youngman.org.uk \
    --cc=fdp@fkoop.de \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.