Bug 51231 - Bug in GREP causes raid initialization to fail
Summary: Bug in GREP causes raid initialization to fail
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts   
(Show other bugs)
Version: 7.1
Hardware: All Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2001-08-08 16:53 UTC by Need Real Name
Modified: 2014-03-17 02:22 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-08-08 16:53:12 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Need Real Name 2001-08-08 16:53:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)

Description of problem:
Acording to every page I've ever seen, the command "grep 
^raiddev /etc/raidtab" should return lines where the characters "raiddev" 
are the first non-whitespace characters on the line. However, grep 2.4.2 
has a bug that is forcing that command to return null unless there is NO 
whitespace before the search string. Because it return only strings with 
NO whitespace on the line before the characters, the inittab scripts 
assume no raid devices need to be started unless they begin on column 1. 
However, if there ARE raid devices to be started, they will not mount 
because they were not started. For the time being I have fixed this 
(somewhat) by removing the ^ from the grep line for raiddev. This works 
(albeit it is an ugly fix). Until the GNU/FSF guys get that bug fixed, it 
would be wise to include some kind of a work around.

How reproducible:

Steps to Reproduce:
Raidtab file:
       raiddev /dev/md0
           raid-level              5
           nr-raid-disks           3
           nr-spare-disks          0
           persistent-superblock   1
           parity-algorithm        left-symmetric
           chunk-size              128k

           device                  /dev/hdb1
           raid-disk               0
           device                  /dev/hdc1
           raid-disk               1
           device                  /dev/hdd1
           raid-disk               2

1. grep raiddev /etc/raidtab
(returns "       raiddev /dev/md0")
2. grep ^raiddev /etc/raidtab
(returns "")
3. grep ^/dev /etc/fstab
(returns all lines with /dev as the first four characters on that line)

Actual Results:  as described above.

Expected Results:  grep on raidtab with ^raiddev should work, 
returning        raiddev /dev/md0

Additional info:

Bug reported on GNU bug tracking site.

Comment 1 Bill Nottingham 2001-08-08 21:56:54 UTC
Changed in 6.12-1 to "^[^#]*raiddev", which should work.

FWIW, it seems grep is using the right behavior here.

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