wrong --detail --test
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mdadm (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Degradation in 3.2 to 3.3.4, last working 3.2.6.
mdadm --detail --test returns 0 on for degraded array, when only the second of two disks is removed, works as expected when the first disk removed.
Expected:
--test -t : exit status 0 if ok, 1 if degrade, 2 if dead, 4 if missing
Expected:
mdadm --detail /dev/md2 --test ; echo $?
/dev/md2:
Version : 1.2
Creation Time : Thu Dec 10 11:50:20 2015
Raid Level : raid1
Array Size : 780226240 (744.08 GiB 798.95 GB)
Used Dev Size : 780226240 (744.08 GiB 798.95 GB)
Raid Devices : 2
Total Devices : 1
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Thu Dec 10 11:50:22 2015
State : active, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
Name : A1
UUID : 333592b4:
Events : 24
Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 34 1 active sync /dev/sdc2
1
^^ not a bug
Bug:
mdadm --detail /dev/md1 --test ; echo $?
/dev/md1:
Version : 1.2
Creation Time : Thu Dec 10 11:39:41 2015
Raid Level : raid1
Array Size : 780226240 (744.08 GiB 798.95 GB)
Used Dev Size : 780226240 (744.08 GiB 798.95 GB)
Raid Devices : 2
Total Devices : 1
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Thu Dec 10 11:42:35 2015
State : active, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
Name : A1
UUID : 6a29c716:
Events : 32
Number Major Minor RaidDevice State
0 8 18 0 active sync /dev/sdb2
2 0 0 2 removed
0
^^^ BUG