Md0 : active (auto-read-only) in /proc/mdadm

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

Ever seen this message in your /proc/mdstat right after you boot the server and wondered what it is?

# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 sda3[0] sdb3[1]
1458830400 blocks [2/2] [UU]
md1 : active raid1 sda2[0] sdb2[1]
2104448 blocks [2/2] [UU]
md0 : active (auto-read-only) raid1 sda1[0] sdb1[1]
4200896 blocks [2/2] [UU]
unused devices: <none>

Your array is not broken - it simply means nothing was yet written to that array (unless you were changing anything with --readonly option to mdadm).

I.e. if a mounted filesystem is on a given device, you are unlikely to see this. On a swap device, however, you may see it.

Assuming the device is /dev/md0 and is used for swap, do a:

# swapoff /dev/md0
# mkswap /dev/md0
# swapon /dev/md0

and you will see “auto-read-only” is gone (careful, if you use UUIDs).