In systemd/mdadm.shutdown from mdadm, it also do "mdadm --wait-clean --scan". But in ubuntu we do not install mdadm-shutdown.service, and do ship finalrd hook.
$ cat ./debian/mdadm.finalrd
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only
set -e
if [ "$1" = "setup" ]
then
. /usr/share/initramfs-tools/hook-functions
copy_exec /sbin/mdadm
copy_exec /sbin/mdmon
In systemd/ mdadm.shutdown from mdadm, it also do "mdadm --wait-clean --scan". But in ubuntu we do not install mdadm-shutdown. service, and do ship finalrd hook.
$ cat ./debian/ mdadm.finalrd Identifier: GPL-3.0-only
#!/bin/sh
# SPDX-License-
set -e
if [ "$1" = "setup" ] initramfs- tools/hook- functions
then
. /usr/share/
copy_exec /sbin/mdadm
copy_exec /sbin/mdmon
exit 0
fi
mdmon --all --takeover
mdadm -vv --wait-clean --scan
mdadm -vv --stop --scan