...
# mdadm --manage --fail /dev/md1 /dev/sdb2
mdadm: set /dev/sdb2 faulty in /dev/md1
# mdadm --manage --remove /dev/md1 /dev/sdb2
mdadm: hot removed /dev/sdb2 from /dev/md1
# mdadm --zero-superblock /dev/sdb2
mdadm: Unrecognised md component device - /dev/sdb2
[probably failed normally works; the example above was because sdb was badhad failed]
# echo "1" > /sys/block/sdb/device/delete
...
GRUB2 can be configured to include md support so can assemble the /boot md before loading initrd (or the kernel directly) but Blue Light does not do this.
Start all md devices
Some linux system integrated an mdadm tool called mdadm-startall. You can install it if not already done.
It doesn't require any argument and will assemble all the md devices found.
...
accepts what the distro delivers.
Routine maintenance
checkarray
...
/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
mdadm syntax table
In case mdadm --help and the mdam man page are not what is needed.
The man page says the general syntax is
mdadm [mode] [options] <component-devices>
But that does not agree with mdadm --help output which lists ... mdadm mode device options...
mdadm mode [option ...] devices
... and notes that the --manage mode can be omitted.
BusyBox mdam commands are more consistent than the full commands; options always come before devices.
Mode | device before options | Options | Notes |
---|---|---|---|
--assemble | Y | bitmap, uuid, super-minor, name, config, scan, run, force, update, no-degraded | |
--build | Y | ||
--create | Y | ||
--grow | N | ||
--incremental | No options | ||
--misc | N | ||
--manage | Y | add, remove, fail, set-faulty, run, stop, readonly, readwrite | --manage may be omitted |
--monitor | No device |
Troubleshooting
initrd fails to assemble md devices
...