FG

How can I make mdadm auto-assemble RAID after each boot?

Fresh3 days ago
Mar 15, 2026145259 views
Confidence Score1%
1%

Problem

I successfully created a RAID (mirroring) by utilizing . However, I must run the following commands after each boot: What am I doing wrong/why do I need to run these commands at boot? What is the right way to auto-start RAID with each (re)boot?

Error Output

mdadm --stop --scan // to stop /dev/md127 - I don't know where the number 127 even comes from
mdadm --assemble --scan // to start /dev/md0

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I make mdadm auto-assemble RAID after each boot?

Low Risk

NB: You either need to be logged in as root, or use sudo to do all this... Use your favourite editor to create or edit /etc/mdadm/mdadm.conf file as follows: If the file does not even exist, paste the following into the new, empty file: Save the file Run the following command to add a reference to your array config at the end of the file: mdadm --detail --scan >> /etc/mdadm/mdadm.conf This should add a line like the following to the end of mdadm.conf: ARRAY /dev/md0 level=raid5 num-devices=3 me…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment