Posts Tagged ‘Raid’

How to get the status of a Linux software raid?

Monday, August 3, 2009 posted by Till

The current status of a Linux software raid is written to the file /proc/mdstat. You can view the status on the shell with the command:

cat /proc/mdstat

The output will look similar to this:

server:~# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4]
md2 : active raid1 sda3[0] sdb3[1]
726266432 blocks [2/2] [UU]

md1 : active (auto-read-only) raid1 sda2[0] sdb2[1]
4200896 blocks [2/2] [UU]
resync=PENDING

md0 : active raid1 sda1[0] sdb1[1]
2104448 blocks [2/2] [UU]

The above setup is a raid 1 system, this means that the data is mirrored to both disks. If one disk would have failed, you would see [_U] when the first disk has failed or [U_] when the second disk has failed in the output instead of [UU].