lk/system/mdadm.md

42 lines
900 B
Markdown
Raw Normal View History

2022-01-18 12:51:14 +00:00
---
title: "mdadm"
tags: [ "Documentation", "RAID" ]
---
2022-01-14 11:32:40 +00:00
# RAID5
You will need 4 disks and the `mdadm` package.
The total size will be equal to the disks x 3, because one will be used for redundancy.
```bash
sudo mdadm --create --verbose /dev/*md127* --level=5 --raid-devices=*4* */dev/sdb /dev/sdc /dev/sdd /dev/sde*
```
2022-01-14 11:32:40 +00:00
Note the variable parts:
- The name of the device could be `/dev/md12` or whatever
- The number of devices could be larger, but must be at least 4 for raid 5
- We end by listing all devices in the new `md` device.
Now look at how the raid status:
```bash
cat /proc/mdstat
```
2022-01-14 11:32:40 +00:00
This will increase until the entire thing is fine.
Check the health of your `mdadm` array:
```bash
sudo mdadm --detail /dev/md127
```
2022-01-14 11:32:40 +00:00
You should see `State : clean`. If you see it is `degraded`, then a disk has broken.
## Replacing a Disk
```bash
sudo mdadm --add /dev/md127 /dev/sdb1
```
2022-01-14 11:32:40 +00:00