Forrest logo
back to the mdadm tool

mdadm:tldr:f8d12

mdadm: Create array.
$ sudo mdadm --create ${-dev-md-MyRAID} --level ${raid_level} --raid-devices ${number_of_disks} ${-dev-sdXN}
try on your machine

The given command is used to create a RAID array using the mdadm tool on a Linux system with sudo privileges. Let's break down the components and their meanings:

  • sudo: It is a command that allows the user to run programs with the security privileges of another user, usually the superuser (root).
  • mdadm: It is a command-line utility used to manage MD (Multiple Device) devices, also known as software RAID arrays, on Linux systems.
  • --create: This flag is used to inform mdadm that we want to create a new RAID array.
  • ${-dev-md-MyRAID}: This is a placeholder representing the desired name of the RAID device. You need to replace ${-dev-md-MyRAID} with the name you want to give to your RAID device.
  • --level ${raid_level}: This flag specifies the RAID level to be used. You need to replace ${raid_level} with the desired RAID level (e.g., 0, 1, 5, etc.).
  • --raid-devices ${number_of_disks}: This flag indicates the number of disks involved in the RAID array. You need to replace ${number_of_disks} with the actual number of disks you want to use.
  • ${-dev-sdXN}: This is a placeholder representing the device names of the disks to be used in the RAID array. You need to replace ${-dev-sdXN} with the actual names of the disks you want to use (e.g., /dev/sda, /dev/sdb, etc.). X in sdXN represents the drive letter, and N denotes the partition number.

To use the command correctly, you should replace the placeholders with appropriate values based on your requirements and disk configuration.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mdadm tool