-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhh_ssacli.txt
99 lines (74 loc) · 1.87 KB
/
hh_ssacli.txt
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
## SSACLI
### Show config
```bash
ssacli ctrl all show config
ssacli ctrl all show config detail
```
### Turn on led
```bash
ssacli ctrl slot=3 physicaldrive 4C:2:2 modify led=on
```
### Delete array
```bash
ssacli ctrl slot=3 array B delete
```
### create raid0
```bash
ssacli ctrl slot=0 create type=ld drives=2I:1:21,2I:1:22,2I:1:23,2I:1:24,2I:1:25 raid=0 stripsize=1024 sectors=32 forced
```
### Modo HBA
```bash
ssacli controller slot=0 modify hbamode=on
``
### More commands
https://ubuntu.com/blog/microk8s-memory-optimisation
## MDAM [Software Raid](https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04)
### Create Raid
```bash
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb
```
### Show status
```bash
cat /proc/mdstat
```
### Show detail
```bash
mdadm --detail /dev/md0
```
### Persist Raid
```bash
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u
```
### Mark the disk as failed
```bash
mdadm --manage /dev/md0 --fail /dev/sdb1
```
### Remove the disk by mdadm
```bash
mdadm --manage /dev/md0 --remove /dev/sdb1
```
### Copy the partition table to the new disk
After replace the faulty disk with new one
```bash
sfdisk -d /dev/sda | sfdisk /dev/sdb
```
### Add the new HDD to the raid
```bash
mdadm --manage /dev/md0 --add /dev/sdb1
```
### Recreate Raid when could not be recovered without losing data
Try this in one of two raids
```bash
mdadm --create --assume-clean --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda missing
```
## LVM
### Format and create LVM
```bash
root@microserver:~ # pvcreate /dev/md0
Physical volume "/dev/md0" successfully created.
root@microserver:~ # vgcreate vg-data /dev/md0
Volume group "vg-data" successfully created
root@microserver:~ #lvcreate -L 1000GB --name data vg-data
Logical volume "data" created.
```