System and processes

The mdadm command

Creates and manages software RAID: mirror (raid1), parity (raid5), etc.

Syntax

sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc

Most useful options

--createCreate the array
--levelRAID level (1, 5...)
--detailShow array status
--stopStop the array

Copy-ready examples

$ sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdcCreate a mirror
$ sudo mdadm --detail /dev/md0See status

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • RAID1 needs at least 2 disks; the array appears as /dev/md0.

Related commands

FAQ

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course