Skip to contentSkip to conversation

/dev/md/xxx sporadically unavailable after mdadm --assemble /dev/md/xxx

DISCUSSION Andrei Borzenkov 1 participant 1 message Mar 15, 2015 MD RAID

lore
Share & tools
lore
#0 lore raw

I hit this when running test suite that is using Linux MD over loop devices. Sporadically it fails to mount raid after mdadm --assembly with

mdadm: array /dev/md/mdraid10_raid1_6 started.
mdadm: stopped /dev/md/mdraid10_raid1_6
mdadm: /dev/md/mdraid10_raid1_6 has been started with 6 drives.
mount: special device /dev/md/mdraid10_raid1_6 does not exist

How naive is the assumption that when "mdadm --assemble" returns devices are available? Should every use of mdadm be now followed by waiting for device?

Code is simply

                xmdraid*)
                    mdadm --assemble /dev/md/"${fs}_$NDEVICES" "${LODEVICES[@]}"
                    sleep 1
                    mount -t "$MOUNTFS" "${MOUNTDEVICE}" "$MNTPOINTRO" -o ${MOUNTOPTS}${SELINUXOPTS}ro ;;

but apparently even one second wait is not enough. But where is the limit?

Of course when you look after test failure all devices are there.

Using mdadm 3.3.1 on openSUSE 13.2.