summaryrefslogtreecommitdiff
path: root/src/raid.thrust
blob: 3c92f270b0a620725e3726d7751d27f2ac0f7346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: Scrappy notes about RAID & mdadm
date: 2020-08-27
---
{% extends 'templates/base.html' %}
{% block body %}
	<nav>
		<a href='/'>&gt; index</a>
	</nav>
	<header>
		<h1>{{ title }}</h1>
	</header>
	<article>
	{% markdown %}

## Recover from a disk failure

Below is "what worked last time", but there is more comprehensive documentation [elsewhere](https://raid.wiki.kernel.org/index.php/RAID_Recovery).

Disconnect the existing RAID array:

```
$ mdadm --stop /dev/md127
```

Create a new array out of the working disks:

```
$ mdadm \
    --verbose \
    --assemble \
    --force \
    /dev/md0 \
    /dev/sdc1 /dev/sdd1
```

Try mounting it, check everything's OK:

```
$ mount /dev/md0 /mnt/md0
```

Add the new disk:

```
$ mdadm --manage /dev/md0 --add /dev/sdb1
```

Watch it rebuild, and hope:

```
$ cat /proc/mdstat
```

## Misc

### Identify a physical disk

```
$ hdparm -I /dev/sda | grep Serial 
```
	{% endmarkdown %}
	</article>
{% endblock %}