LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mdadm

manages Linux software RAID arrays

TLDR

Create RAID array
$ sudo mdadm --create /dev/md/MyRAID --level raid1 --raid-devices 2 /dev/sda1 /dev/sdb1
copy
Stop array
$ sudo mdadm --stop /dev/md0
copy
Mark disk failed
$ sudo mdadm --fail /dev/md0 /dev/sda1
copy
Remove disk
$ sudo mdadm --remove /dev/md0 /dev/sda1
copy
Add disk
$ sudo mdadm --assemble /dev/md0 /dev/sdc1
copy
Show details
$ sudo mdadm --detail /dev/md0
copy
Clear RAID metadata
$ sudo mdadm --zero-superblock /dev/sda1
copy

SYNOPSIS

mdadm [mode] [OPTIONS] device

DESCRIPTION

mdadm manages Linux software RAID arrays (md devices). It can create, assemble, monitor, grow, and manage arrays of various RAID levels including RAID 0, 1, 5, 6, and 10.

PARAMETERS

--create device

Create a new array
--assemble device
Assemble a previously created array
--stop device
Stop an active array
--detail device
Display detailed information about an array
--examine device
Examine RAID superblock on a component device
--fail device component
Mark a component as failed
--remove device component
Remove a component from an array
--add device component
Add a component to an array
--level level
RAID level (0, 1, 5, 6, 10, linear)
--raid-devices n
Number of active devices in array
--zero-superblock device
Erase RAID superblock from a device

INSTALL

sudo apt install mdadm
copy
sudo dnf install mdadm
copy
sudo pacman -S mdadm
copy
sudo apk add mdadm
copy
sudo zypper install mdadm
copy
nix profile install nixpkgs#mdadm
copy

CAVEATS

Creating an array destroys existing data on component devices. RAID is not a backup solution. RAID 5/6 require minimum 3/4 devices respectively. Always monitor arrays for failed drives.

HISTORY

mdadm is the modern Linux software RAID management tool, replacing older raidtools.

SEE ALSO

lsblk(8), blkid(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid