How do I check the status of my RAID array? In Solaris, I used the metastat command, is there an equivalent command in Red Hat Enterprise Linux? How to detect or determine raid level in Red Hat Enterprise Linux?
To check the status of a software RAID array, you can issue the command:
# cat /proc/mdstat
This will give you information on RAID personalities. Example output of this command would look similar to the following:
# cat /proc/mdstat Personalities : [raid0] md0 : active raid0 hdd6 hda6 40692224 blocks 256k chunks
Here we see one striped RAID array that is currently active and has two member devices, hdd6 and hda6. The RAID has a total of 40692224 blocks and the chunk size is 256k.
In the event that your RAID array is rebuilding, this command will give you information on the percentage completion of the rebuild. You can now use the mdadm command to extract further information. Information on mdadm is available by typing man mdadm in a terminal. Following is an example usage of mdadm, based on the example given above:
# mdadm --examine /dev/hda6 /dev/hda6: Magic : a92b4efc Version : 00.90.00 UUID : 28b55174:0f0b055e:29c12adf:a158a4d3 Creation Time : Tue Sep 21 20:53:05 2004 Raid Level : raid0 Device Size : 19534848 (18.63 GiB 20.00 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Update Time : Tue Sep 21 20:53:05 2004 State : dirty Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Checksum : 2fd39a8a - correct Events : 0.1 Chunk Size : 256K Number Major Minor RaidDevice State this 0 3 6 0 active sync /dev/hda6 0 0 3 6 0 active sync /dev/hda6 1 1 22 70 1 active sync /dev/hdd6
Here we are querying one of the devices identified by our use of cat /proc/mdstat. The dirty state means that the volume is currently mounted or that it was not dismounted cleanly before the last boot. It will remain in a dirty state until it is successfully mounted (note that it may already be mounted) and then dismounted.
Please note that the above information applies to software RAID arrays, which are managed by the Red Hat Enterprise Linux operating system. Hardware RAID arrays are presented to the operating system as a single storage device. For information on managing hardware RAID arrays, please contact your hardware vendor.