To recreate:

1. partition two disks sized the same into two equal partitions (2G
disk, two 1G partitions each)

# cat /proc/partitions 
major minor  #blocks  name

 252       32    2097152 vdc
 252       33    1048576 vdc1
 252       34    1047552 vdc2
 252       48    2097152 vdd
 252       49    1048576 vdd1
 252       50    1047552 vdd2

2. sudo apt install mdadm --no-install-recommends

3. sudo bash -x ./create-mirror.sh

4. cat /proc/mdstat  # check that the array's are resyncing

5. sudo mdadm --stop /dev/md1

6. test -e /sys/class/block/md1

If the arrays completely resync before attempting --stop; we don't see the 
failure;
however, if a resync is present then stopping md0 or md1 will succeed but
/sys/class/block/mdX/* contains files even if /dev/mdX is not present.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1682456

Title:
  md devices may leave remnants in /sys/class/block after removal

Status in linux package in Ubuntu:
  Confirmed

Bug description:
  1. root@x1:~# cat /proc/version_signature
  Ubuntu 4.4.0-72.93-generic 4.4.49

  2. attached

  3. # lsb_release -rd
  Description:  Ubuntu 16.04.2 LTS
  Release:      16.04

  4. # apt-cache policy linux-image-`uname -r`
  linux-image-4.4.0-72-generic:
    Installed: 4.4.0-72.93
    Candidate: 4.4.0-72.93
    Version table:
   *** 4.4.0-72.93 500
          500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 
Packages
          500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 
Packages
          100 /var/lib/dpkg/status

  5. After stopping an md device, the sysfs and /dev entry should be
  removed:

  mdadm --stop /dev/md0  && [ "`test -e /sys/class/block/md0`" = "1" ]; echo $rc
  should return 0;

  6. /dev/md0 is gone, but /sys/class/block/md0 remains

  I believe this is related to this thread here:

  https://www.spinics.net/lists/raid/msg54859.html

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: linux-image-4.4.0-72-generic 4.4.0-72.93
  ProcVersionSignature: Ubuntu 4.4.0-72.93-generic 4.4.49
  Uname: Linux 4.4.0-72-generic x86_64
  AlsaDevices:
   total 0
   crw-rw---- 1 root audio 116,  1 Apr 12 21:55 seq
   crw-rw---- 1 root audio 116, 33 Apr 12 21:55 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
  ApportVersion: 2.20.1-0ubuntu2.5
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  Date: Thu Apr 13 14:32:17 2017
  IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
  Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
  PciMultimedia:
   
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcFB:
   
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-72-generic 
root=UUID=4c974bc3-8fe8-41b5-a563-23b2dcf974c9 ro console=tty1 console=ttyS0
  RelatedPackageVersions:
   linux-restricted-modules-4.4.0-72-generic N/A
   linux-backports-modules-4.4.0-72-generic  N/A
   linux-firmware                            N/A
  RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
  SourcePackage: linux
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 04/01/2014
  dmi.bios.vendor: SeaBIOS
  dmi.bios.version: Ubuntu-1.8.2-1ubuntu2
  dmi.chassis.type: 1
  dmi.chassis.vendor: QEMU
  dmi.chassis.version: pc-i440fx-yakkety
  dmi.modalias: 
dmi:bvnSeaBIOS:bvrUbuntu-1.8.2-1ubuntu2:bd04/01/2014:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-yakkety:cvnQEMU:ct1:cvrpc-i440fx-yakkety:
  dmi.product.name: Standard PC (i440FX + PIIX, 1996)
  dmi.product.version: pc-i440fx-yakkety
  dmi.sys.vendor: QEMU

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1682456/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to