Programatically determine if device is in RAID array
Hey all,
I'm writing a bash script that needs to know whether or not a device node is part of a RAID array. I'm just curious if anyone knows of a good way to determine if a device node is in a RAID array. I know that you can run mdadm -Q or mdadm --examine on the device node and that will tell you. But I don't want to rely on screen scrapping and would rather have something that would return a boolean. Any ideas? -Anon |
Well,
To start with, is this for just one of your boxes, or is this going to be for software that is going out to end-users with 'gawd-knows-what' running on their system? Quote:
I would think that if you are definitely looking for a local software RAID that was set up with mdadm, you may want to see what is created under /sys for the drive/filesystem after setting up a RAID with mdadm and try to key on that. HTH. |
This only needs to run on RHEL4. Its always going to be software RAID. I'll take a look through those.
|
All times are GMT -5. The time now is 11:53 PM. |