Forrest logo
back to the mdadm tool

mdadm:tldr:67758

mdadm: Remove disk.
$ sudo mdadm --remove ${-dev-md0} ${-dev-sdXN}
try on your machine

This command is used to remove a device from a Software RAID array using the mdadm tool in Linux. Here's a breakdown of the command:

  • sudo: The command is run with administrative privileges to perform the removal operation.

  • mdadm: It is the command-line tool used for managing and monitoring Software RAID arrays in Linux.

  • --remove: This option instructs mdadm to remove the specified device(s) from the RAID array.

  • ${-dev-md0}: This is a placeholder representing the name of the RAID array that device(s) need to be removed from. Replace ${-dev-md0} with the actual name of the RAID array.

  • ${-dev-sdXN}: This is another placeholder representing the device(s) that need to be removed from the RAID array. Replace ${-dev-sdXN} with the actual device(s) you want to remove. For example, if you want to remove the device /dev/sdb1, replace ${-dev-sdXN} with /dev/sdb1.

Overall, the command sudo mdadm --remove ${-dev-md0} ${-dev-sdXN} is used to remove one or more devices from a designated RAID array.

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