This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 87594 - space indented /etc/raidtab is not processed correctly
space indented /etc/raidtab is not processed correctly
Product: Red Hat Linux
Classification: Retired
Component: mkinitrd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2003-03-29 13:54 EST by Brad Clements
Modified: 2007-04-18 12:52 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-04-02 01:03:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch grep statement to handle space or tab in /etc/raidtab (897 bytes, patch)
2003-03-29 13:57 EST, Brad Clements
no flags Details | Diff

  None (edit)
Description Brad Clements 2003-03-29 13:54:50 EST
Description of problem:

mkinitrd does not add raid modules to the kernel ramdisk if /etc/raidtab has 
been formatted with spaces instead of tabs.

Version-Release number of selected component (if applicable):

version 3.4.28

How reproducible:

Every time

Steps to Reproduce:
1. Convert a non-raid SCSI server to a raid based system following common how-
2. When creating /etc/raidtab, indent lines with spaces instead of tabs. 
Specifically, indent the 'raid-level' line using spaces and no tabs
3. run mkinitrd
Actual results:

mkinitrd does not recognize the raid level specificed in raidtab, so does not 
add raid(x) and raidstart commands to linuxrc

Expected results:

mkinitrd should recognize raid-level lines that are not indented, or are 
indented with spaces or tabs

Additional info:

The problem is due to this grep in mkinitrd:

        for number in $(grep '^[        ]*raid-level' /etc/raidtab 2>/dev/null |
                          awk '{print $2}' | LC_ALL=C sort -u) ; do

You can't tell from the text above, but there is a single tab character in the 
grep regex ^[ ]  pattern.
Comment 1 Brad Clements 2003-03-29 13:57:32 EST
Created attachment 90788 [details]
patch grep statement to handle space or tab in /etc/raidtab
Comment 2 Brad Clements 2003-03-29 14:00:15 EST
I've attached a patch that changes the grep statement to [\t ], but perhaps the 
regex for 'any whitespace' should be used instead. Sorry, I'm not a regex 
wizard so I don't recall what that is [:space:]  ??
Comment 3 Jeremy Katz 2003-04-02 01:03:39 EST
Fixed in the mkinitrd in Red Hat Linux 9

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