Monday, March 26, 2012

mdadm administration and maintenance

check status of a raid:
root@server:/home/markp# mdadm --query --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Wed Jun 16 11:12:17 2010
Raid Level : raid1
Array Size : 732571904 (698.64 GiB 750.15 GB)
Used Dev Size : 732571904 (698.64 GiB 750.15 GB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Mon Mar 26 08:37:54 2012
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

UUID : a796fd2c:740124f9:01f9e43d:ac30fbff (local to host server)
Events : 0.7867161

Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 0 0 1 removed


the two disks of my md0 are sdb1 and sdc1. Add back whichever is degraded:
root@server:/home/markp# mdadm --add /dev/md0 /dev/sdc1
mdadm: added /dev/sdc1
root@server:/home/markp# mdadm --query --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Wed Jun 16 11:12:17 2010
Raid Level : raid1
Array Size : 732571904 (698.64 GiB 750.15 GB)
Used Dev Size : 732571904 (698.64 GiB 750.15 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Mon Mar 26 08:53:20 2012
State : clean, degraded, recovering
Active Devices : 1
Working Devices : 2
Failed Devices : 0
Spare Devices : 1

Rebuild Status : 0% complete

UUID : a796fd2c:740124f9:01f9e43d:ac30fbff (local to host server)
Events : 0.7867463

Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
2 8 33 1 spare rebuilding /dev/sdc1

No comments: