Bug 718247

Summary: rc.sysinit does not run mdadm after init_crypto
Product: Red Hat Enterprise Linux 6 Reporter: nayfield <rod>
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1CC: coughlan, deekej, dlehman, iarlyy, jonathan, opensource, plautrba, pvrabec, rvokal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 575840 Environment:
Last Closed: 2016-11-11 14:37:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description nayfield 2011-07-01 14:57:01 UTC
+++ This bug was initially created as a clone of Bug #575840 +++
+++ but i made description accurate +++

Description of problem:
A raid array on a encrypted lvm volume is not started automatically by rc.syslocal when there aren't any md arrays already.  This is because: 

# grep mdadm /etc/rc.sysinit
[ -r /proc/mdstat -a -r /dev/md/md-device-map ] && /sbin/mdadm -IRs
#

If all the md components are on crypt, /dev/md/md-device-map does not exist at this time.  I think this would work if dracut had set up some md devices earlier, but in my use case it does not.



Version-Release number of selected component (if applicable):
initscripts-9.03.23-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. create a mdadm raid on a encrypted partition
2. don't have any other mdadm raids
  
Actual results:
the raid is not started after boot

Expected results:
the raid is started


Additional info:
The recommendation of doing crypt underneath md came from RH engineering.

This patch fixes the problem on my system (it's after the first init_crypto so the components are detectable):

--- rc.sysinit.el6.1    2011-07-01 10:55:39.066082994 -0400
+++ rc.sysinit  2011-07-01 10:56:02.174082979 -0400
@@ -193,6 +193,7 @@
        fi
 fi
 
+[ -f /etc/mdadm.conf -a -x /sbin/mdadm ] && /sbin/mdadm -As --auto=yes --run
 # Start any MD RAID arrays that haven't been started yet
 [ -r /proc/mdstat -a -r /dev/md/md-device-map ] && /sbin/mdadm -IRs

Comment 2 David Lehman 2011-07-01 15:14:10 UTC
I am curious: Who in Red Hat engineering recommended encrypting raid member devices instead of encrypting the raid device itself? This configuration is discouraged to the point that it was not even supported in RHEL5.

Comment 3 nayfield 2011-07-01 16:55:59 UTC
(I emailed you off-bz.)

Crypt below seemed to be consensus when asking around, admittedly most of them didn't have the same case (laptop single disk) that I have for raid.  

In the GUI, anaconda seems to let you do either.

Of course, there's more than one way to do it and I'm open to pro/con arguments as to which way to go.

I didn't do any benchmarking, but I guess it depends on where the bottleneck lies - is it better to do crypt on bottom and have 4 dmcrypt threads underneath, or above md and only have one? 

As far as other combinations, I'm probably indifferent between lvm>crypt>md and crypt>lvm>md.   

The latter (crypt on top) would let me use urandom to have swap unrecoverable after reboot but I don't really care about that use case.   I don't really swap much anyway, so I've still got a single crypt thread for all the iops.

The former (crypt in middle) would protect lvm metadata, so nobody would know that my LV is called vg1_take_over_world_project but, oops, I posted it in bugzilla.  

I'm also not using md or crypt for the root filesystem.  If I were I think md-device-map would exist at sysinit time and I'd have a chance of perhaps using the config file start the array without patching sysinit.

Comment 4 nayfield 2011-07-01 16:56:24 UTC
title changed to reflect el6 reality

Comment 5 Suzanne Logcher 2011-10-06 18:50:49 UTC
Since RHEL 6.2 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.
               
Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2013-10-14 05:16:32 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 7 Lukáš Nykrýn 2016-11-11 14:37:47 UTC
There was no activity in the bugzilla for a long time (4 years). Since we are already in production phase 2, we should not make any changes in this area.