dmraid: How best to detect if dmraid devices are present

Frans Pop elendil at planet.nl
Wed Jul 18 04:00:48 UTC 2007


Hello,

I've been working on implementing dmraid support in the Debian Installer, 
and have been using 'dmraid -s -c' to detect if any dmraid sets are 
present.

Problem with that is that 'dmraid -s -c' will in at least two situations 
exit zero and display what for my purposes is effectively an error 
message on stdout:
- no block devices found
- No RAID disks

Having to grep for these messages is of course not very clean, especially 
as I can't be sure to cover all possible conditions.

Was there a particular reason why it was decided to exit 0 in those cases 
and direct those messages to stdout instead of stderr? Would it be an 
option to change this?

Is there perhaps a better way to detect if any dmraid devices are present 
that does not suffer from this issue?

An alternative I was thinking of myself is the following, but that is 
still not very clean:
# dmraid -s -c r,t --sep "%" | grep "%" | cut -d% -f1

Thanks in advance,

Frans Pop
Debian Installer developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/ataraid-list/attachments/20070718/e3d777e6/attachment.sig>


More information about the Ataraid-list mailing list