Bug 220473 - sraid.i - /etc/mdadm.conf not parsed correctly
Summary: sraid.i - /etc/mdadm.conf not parsed correctly
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: initng-ifiles
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Malmgren
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-21 16:19 UTC by Jason Farrell
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-12-22 08:23:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch (872 bytes, patch)
2006-12-21 16:19 UTC, Jason Farrell
no flags Details | Diff

Description Jason Farrell 2006-12-21 16:19:13 UTC
Description of problem:
mdadm software raid arrays aren't not assembled because /etc/mdadm.conf is not
parsed correctly (into a list of devices).

Version-Release number of selected component (if applicable):
initng-ifiles-0.0.6-2.fc6

How reproducible:
Always

Steps to Reproduce:
1. have a mdadm raid array in /etc/mdadm.conf to be assembled
2. ng-update add sraid
3. reboot
  
Actual results:
No arrays are assembled. Boot fails miserably.

Expected results:
All arrays assembled.

Additional info:
The reason why this happens is because the same line is being used to extract
raid device names from /etc/mdadm.conf as the old /etc/raidtab, but they have a
different number of fields.

Example mdadm.conf entry:
ARRAY /dev/md2 level=raid0 num-devices=2 UUID=943af5fe:15ae3b82:aa7ad701:0828875b

Example raidtab entry:
raiddev /dev/md0

So, this doesn't work:
[ -f /etc/mdadm.conf ] && mdadm_devices=`/bin/grep '^[[:space:]]*ARRAY'
/etc/mdadm.conf | /bin/sed
's/^[[:space:]]*ARRAY[[:space:]]\+\([^[:space:]]\+\)/\1/'`
But this will (for both):
[ -f /etc/mdadm.conf ] && mdadm_devices=`/bin/awk '/^[:space:]*ARRAY/ {print
$2}' /etc/mdadm.conf`





Simple patch:

Comment 1 Jason Farrell 2006-12-21 16:19:13 UTC
Created attachment 144197 [details]
patch

Comment 2 Daniel Malmgren 2006-12-22 08:23:56 UTC
Hmmm... Looks like deac beat me to it on this one as well. It's fixed in svn.

(Deac, could you please leave a note in bz when you fix stuff. It would save me
time trying to fix what's already fixed ;-)


Note You need to log in before you can comment on or make changes to this bug.