Comment 8 for bug 1618429

Revision history for this message
Ryan Harper (raharper) wrote :

The flow of execution for this bug is:

curtin is instructed to wipe the superblock of the devices in the storage config.
For each disk, we need to attempt to see if it may be part of mdadm array which allows curtin to determine how to wipe mdadm metadata. In this process, curtin invokes the mdadm --assemble --scan mode to discover the possible arrays. The current code that's been tested expected return codes of 0, 1 or 2. However, in your case, it's returned 3; this is an unexpected output.

I've not been able to recreate the mdadm --assemble --scan return code of 3; the mdadm code does not easily reveal why it returns 3 in the above case versus the consistent return code of 1 when I recreate missing elements of the array on trusty.

root@ubuntu:/curtin# mdadm --assemble --scan -vv
mdadm: looking for devices for /dev/md/0
mdadm: no RAID superblock on /dev/sdi
mdadm: no RAID superblock on /dev/sde
mdadm: no RAID superblock on /dev/sdc
mdadm: no RAID superblock on /dev/sdd
mdadm: no RAID superblock on /dev/sdb
mdadm: no RAID superblock on /dev/sda2
mdadm: no RAID superblock on /dev/sda1
mdadm: no RAID superblock on /dev/sda
mdadm: cannot open device /dev/sr0: No medium found
mdadm: no RAID superblock on /dev/vda
mdadm: /dev/sdh is identified as a member of /dev/md/0, slot 6.
mdadm: /dev/sdg is identified as a member of /dev/md/0, slot 5.
mdadm: /dev/sdf is identified as a member of /dev/md/0, slot 4.
mdadm: no uptodate device for slot 0 of /dev/md/0
mdadm: no uptodate device for slot 1 of /dev/md/0
mdadm: no uptodate device for slot 2 of /dev/md/0
mdadm: no uptodate device for slot 3 of /dev/md/0
mdadm: added /dev/sdg to /dev/md/0 as 5
mdadm: added /dev/sdh to /dev/md/0 as 6
mdadm: no uptodate device for slot 7 of /dev/md/0
mdadm: added /dev/sdf to /dev/md/0 as 4
mdadm: /dev/md/0 assembled from 3 drives - not enough to start the array.
root@ubuntu:/curtin# echo $?
1

That said, it's unlikely that we actually care about any assemble errors doing the portion of the code where we're attempting to wipe a disk of any previous metadata. We're currently investigating a case where failure to assemble an array prevented new arrays from being constructed (lvm for example refuses to use devices with mdadm metadata present). If we can determine that assemble is required, we'll update the curtin mdadm code to allow us to catch and ignore errors during the wipe case as needed.