tldr/pages/linux/mdadm.md

33 lines
618 B
Markdown
Raw Normal View History

# mdadm
2014-08-04 04:31:06 +01:00
> RAID management utility.
> More information: <https://manned.org/mdadm>.
2014-08-04 04:31:06 +01:00
- Create array:
2014-08-04 04:31:06 +01:00
`sudo mdadm --create {{/dev/md/MyRAID}} --level {{raid_level}} --raid-devices {{number_of_disks}} {{/dev/sdXN}}`
2014-08-04 04:31:06 +01:00
- Stop array:
2014-08-04 04:31:06 +01:00
`sudo mdadm --stop {{/dev/md0}}`
2014-08-04 04:31:06 +01:00
- Mark disk as failed:
2014-08-04 04:31:06 +01:00
`sudo mdadm --fail {{/dev/md0}} {{/dev/sdXN}}`
2014-08-04 04:31:06 +01:00
- Remove disk:
2014-08-04 04:31:06 +01:00
`sudo mdadm --remove {{/dev/md0}} {{/dev/sdXN}}`
2014-08-04 04:31:06 +01:00
- Add disk to array:
2014-08-04 04:31:06 +01:00
`sudo mdadm --assemble {{/dev/md0}} {{/dev/sdXN}}`
2014-08-04 04:31:06 +01:00
- Show RAID info:
2014-08-04 04:31:06 +01:00
`sudo mdadm --detail {{/dev/md0}}`
- Reset disk by deleting RAID metadata:
`sudo mdadm --zero-superblock {{/dev/sdXN}}`