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

- From: Andrei Borzenkov \<hidden\>
- Date: 2015-03-15 07:42:55 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2015/03/6629188
- Thread: https://ratatoskr.run/linux-raid/2015/03/6629188/t.md

```text
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.
```
