Mdadm –detail command is not displaying the state of a degraded md array as degraded

Bug #1543003 reported by NEEBA V V
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
New
Undecided
Unassigned

Bug Description

The problem is :
Mdadm –detail command is not displaying the state of an md array as degraded, when actually the array is in degraded state:
Expected behavious is State should be 'Clean,degraded' for a degraded md array.

OS : Ubuntu 14.04.3 LTS
Kernel : 4.2.0-23-generic
mdadm v. 3.2.5-5

1. Create a md array
# mdadm --create /dev/md500 -n2 -l1 /dev/disk/by-id/scsi-3644a84203ba22f001d6f5278428ed6e6 /dev/disk/by-id/scsi-3644a84203ba22f001d6f527d42d5713d
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device. If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md500 started.

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md500 : active raid1 sdc[1] sdb[0]
      20955008 blocks super 1.2 [2/2] [UU]

unused devices: <none>

# mdadm --detail /dev/md500
/dev/md500:
        Version : 1.2
  Creation Time : Mon Feb 1 11:14:34 2016
     Raid Level : raid1
     Array Size : 20955008 (19.98 GiB 21.46 GB)
  Used Dev Size : 20955008 (19.98 GiB 21.46 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Mon Feb 1 11:16:19 2016
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : blrfsserv149:500 (local to host blrfsserv149)
           UUID : ff415711:f14f374c:b61831d4:0558303e
         Events : 17

    Number Major Minor RaidDevice State
       0 8 16 0 active sync /dev/sdb
       1 8 32 1 active sync /dev/sdc

2. Offline a device using scsi offline command
# echo 1 > /sys/bus/scsi/devices/0:2:1:0/delete

3. Check the mdadm --details, the state is still 'clean'
Expected behavious is State should be 'Clean,degraded'

# mdadm --detail /dev/md400
/dev/md400:
        Version : 1.2
  Creation Time : Mon Feb 1 17:36:08 2016
     Raid Level : raid1
     Array Size : 20955008 (19.98 GiB 21.46 GB)
  Used Dev Size : 20955008 (19.98 GiB 21.46 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Mon Feb 1 17:46:05 2016
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : blrfsserv149:400 (local to host blrfsserv149)
           UUID : 00728830:7dd439a9:e1abe1bf:d8ab91b5
         Events : 2

    Number Major Minor RaidDevice State
       0 8 16 0 active sync
       1 8 32 1 active sync /dev/sdc

affects: ubuntu-release-upgrader (Ubuntu) → mdadm (Ubuntu)
Revision history for this message
NEEBA V V (neeba-vv) wrote :

I have observed that:
If md array is created with partitioned disk, the state change with array degrade is working as expected.
Verified with kernel 4.2.0-23-generic

1. Create md array with partitioned disk
# mdadm --detail /dev/md500
/dev/md500:
Version : 1.2
Creation Time : Mon Feb 15 16:17:59 2016
Raid Level : raid1
Array Size : 11709312 (11.17 GiB 11.99 GB)
Used Dev Size : 11709312 (11.17 GiB 11.99 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent

Update Time : Mon Feb 15 16:19:55 2016
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Name : blrfsserv149:500 (local to host blrfsserv149)
UUID : d76dbca0:5ff06b36:8057cfde:96d9475b
Events : 17

Number Major Minor RaidDevice State
0 8 81 0 active sync /dev/sdf1
1 8 97 1 active sync /dev/sdg1

2. Offline the scsi device using scsi command
# lsscsi | grep sdf
[0:2:5:0] disk DELL PERC H730 Mini 4.25 /dev/sdf

# echo 1 > /sys/bus/scsi/devices/0:2:5:0/delete
# lsscsi | grep sdf

3. Check the details of md array, the state is changed from clean to clean,degraded
# mdadm --detail /dev/md500
/dev/md500:
Version : 1.2
Creation Time : Mon Feb 15 16:17:59 2016
Raid Level : raid1
Array Size : 11709312 (11.17 GiB 11.99 GB)
Used Dev Size : 11709312 (11.17 GiB 11.99 GB)
Raid Devices : 2
Total Devices : 1
Persistence : Superblock is persistent

Update Time : Mon Feb 15 16:21:02 2016
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

Name : blrfsserv149:500 (local to host blrfsserv149)
UUID : d76dbca0:5ff06b36:8057cfde:96d9475b
Events : 20

Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 97 1 active sync /dev/sdg1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.