Bug 51231 - Bug in GREP causes raid initialization to fail
Bug in GREP causes raid initialization to fail
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.1
All Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-08 12:53 EDT by Need Real Name
Modified: 2014-03-16 22:22 EDT (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-08-08 12:53:08 EDT
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:
Always

Steps to Reproduce:
(example)
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 17:56:54 EDT
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.